The method getChars() is used for copying String characters to an Array of chars. public void getChars(int srcBegin, int srcEnd, char[] dest, int destBegin) Parameters… [Read More]
Java – String toLowerCase() and toUpperCase() Methods
The method toLowerCase() converts the characters of a String into lower case characters. It has two variants: String toLowerCase(Locale locale): It converts the string into… [Read More]
Java String replace(), replaceFirst() and replaceAll() methods
In this tutorial, we will discuss replace(), replaceFirst()and replaceAll() methods. All of these Java String methods are mainly used for replacing a part of String… [Read More]
Java String split() Method with examples
Java String split method is used for splitting a String into substrings based on the given delimiter or regular expression. For example: Input String: chaitanya@singh… [Read More]
Java String substring() Method with examples
The substring() method is used to get a substring from a given string. This is a built-in method of string class, it returns the substring… [Read More]
Java String startsWith() Method with examples
The startsWith() method of String class is used for checking prefix of a String. It returns a boolean value true or false based on whether… [Read More]
Java String length() Method with examples
Java String length() method is used to find out the length of a String. This method counts the number of characters in a String including… [Read More]
Java String lastIndexOf() Method with example
In the last tutorial we discussed indexOf() method, which is used to find out the occurrence of a specified char or a substring in the… [Read More]
Java String indexOf() Method
Java String indexOf() method is used to find the index of a specified character or a substring in a given String. Here are the different… [Read More]
Java String equals() and equalsIgnoreCase() Methods example
In this tutorial we will discuss equals() and equalsIgnoreCase() methods. Both of these methods are used for comparing two strings. The only difference between them… [Read More]
Java String endsWith() Method with example
Java String endsWith(String suffix) method checks whether the String ends with a specified suffix. This method returns a boolean value true or false. If the… [Read More]
Java – String copyValueOf() Method example
The method copyValueOf() is used for copying an array of characters to the String. The point to note here is that this method does not… [Read More]
Java – String contentEquals() Method example
The method contentEquals() compares the String with the String Buffer and returns a boolean value. It returns true if the String matches to the String… [Read More]
Java String concat() Method example
Java string concat() method concatenates multiple strings. This method appends the specified string at the end of the given string and returns the combined string…. [Read More]
Java String compareToIgnoreCase() Method example
The Java String compareToIgnoreCase() method compares two strings lexicographically and returns 0 if they are equal. As we know compareTo() method does the same thing,… [Read More]