Check if a string consists only of special characters
Given string str of length N, the task is to check if the given string contains only special characters or not. If the string contains only special characters, then print “Yes”. Otherwise, print “No”....
read more
How to check if string contains only digits in Java
Given string str, the task is to write a Java program to check whether a string contains only digits or not. If so, then print true, otherwise false....
read more
Generate random String of given size in Java
Given a size as n, The task is to generate a random alphanumeric String of this size. Below are various ways to generate random alphanumeric String of given size: Prerequisite : Generating random numbers in Java...
read more
How to split a string in C/C++, Python and Java?
Splitting a string by some delimiter is a very common task. For example, we have a comma-separated list of items from a file and we want individual items in an array. Almost all programming languages, provide a function split a string by some delimiter....
read more
How to Extract a Specific Line from a Multi-Line String in Java?
In Java, String Plays an important role. As String stores or we can say it is a collection of characters. We want to get a specific line from a multi-line String in Java. This can also be done in Java....
read more
Java Program to Check Strings Anagram Using HashMap
Java Program to check whether two given strings are anagrams of each other or not using HashMap....
read more
Java Program to Iterate Over Characters in String
Given string str of length N, the task is to traverse the string and print all the characters of the given string using java....
read more
Java Program to Convert String to Char Stream Without Using Stream
Char stream defines the array of characters. In this article, we will learn the different types of methods for converting a String into a char stream in Java without using Stream. Let us see some methods one by one....
read more
Java Program to Convert String to Float Value
Given a string “str” in Java, the task is to convert this string to float type....
read more
How to Optimize String Concatenation in Java?
Strings are defined as an array of characters. The difference between a character array and a string is the string is terminated with a special character ‘\0’. Since arrays are immutable(cannot grow), Strings are immutable as well. Whenever a change to a String is made, an entirely new String is created....
read more
Different Ways to Print First K Characters of the String in Java
Given a string str and a positive integer k, the task is to write a Java program to print the first k characters of the string. If the length of the string is less than k then print the string as it is....
read more
Java Program to Determine the Unicode Code Point at Given Index in String
ASCII is a code that converts the English alphabets to numerics as numeric can convert to the assembly language which our computer understands. For that, we have assigned a number against each character ranging from 0 to 127. Alphabets are case-sensitive lowercase and uppercase are treated differently. Complete ASCII values table can be interpreted but better it is sticking to the table in the illustration below where no need arises to lean complete ASCII values in a table. Extremities are assigned as follows so as order to guess the Unicode value correctly with memorizing the complete table. With this table, one can extract all alphabets Unicode be it uppercase or lowercase....
read more