Java String Methods
String valueOf()
The java string valueOf() method converts different types of values into string. By the help of string valueOf() method, you can convert int to string,…
String trim()
The java string trim() method eliminates leading and trailing spaces. The unicode value of space character is ‘\u0020’. The trim() method in java string checks…
String toUpperCase()
The java string toUpperCase() method returns the string in uppercase letter. In other words, it converts all characters of the string into upper case letter….
String toLowerCase()
The java string toLowerCase() method returns the string in lowercase letter. In other words, it converts all characters of the string into lower case letter….
String toLowerCase()
The java string toLowerCase() method returns the string in lowercase letter. In other words, it converts all characters of the string into lower case letter….
String substring()
The java string substring() method returns a part of the string. We pass begin index and end index number position in the java substring method…
String startswith()
The java string startsWith() method checks if this string starts with given prefix. It returns true if this string starts with given prefix else returns…
String split()
The java string split() method splits this string against given regular expression and returns a char array. Signature There are two signature for split() method…
String replaceAll()
The java string replaceAll() method returns a string replacing all the sequence of characters matching regex and replacement string. Signature public String replaceAll(String regex, String replacement) Parameters regex : regular…
String replace()
The java string replace() method returns a string replacing all the old char or CharSequence to new char or CharSequence. Since JDK 1.5, a new…