Skip to content

Tag Archives: Java-Strings

The java string getChars() method copies characters from the given string into the destination character array.Syntax:   public void getChars(int srhStartIndex, int srhEndIndex, char[] destArray, int… Read More
In java, String format() method returns a formatted string using the given locale, specified format string, and arguments. We can concatenate the strings using this… Read More
The java string endsWith() method checks whether the string ends with a specified suffix.This method returns a boolean value true or false. Signature: public boolean… Read More
The Java String concat() method concatenates one string to the end of another string. This method returns a string with the value of the string… Read More
The Java String charAt() method returns the character at the specified index. The index value should lie between 0 and length()-1. Signature: public char charAt(int… Read More
java.lang.String.contains() method searches the sequence of characters in the given string. It returns true if sequence of char values are found in this string otherwise… Read More
Java.lang.String.isEmpty() String method checks whether a String is empty or not. This method returns true if the given string is empty, else it returns false.… Read More
A Pandigital Number is number which makes the use of all digits 1 to 9 exactly once. We are given a number, we need to… Read More
The StringBuffer.insert() method inserts the string representation of given data type at given position in a StringBuffer. Syntax: str.insert(int position, char x); str.insert(int position, boolean… Read More
The equalsIgnoreCase() method of the String class compares two strings irrespective of the case (lower or upper) of the string. This method returns a boolean… Read More
Consider the following codes in java:   Java // This program prints false class GFG {     public static void main(String[] args) {     StringBuffer sb1 =… Read More
Write a Java program to take an input string and exchange the first and last word and reverse the middle word. Examples:  Input : Hello… Read More
Compare string initialization performance for String Literal and String object. String Literal String str = “GeeksForGeeks”; This is string literal. When you declare string like… Read More
Given a numeric string (length <= 32), split it into two or more integers( if possible), such that 1) Difference between current and previous number is… Read More

Start Your Coding Journey Now!