The java.lang.String class provides various list of methods to perform operations to alter and manipulate on sequence of char values. Some of these methods are listed below
This methods returns the total length of the string or total number of character in string
Knowledge2life
Length is: 24
Concat() method is used to return a combined string or can be also used as an alternative to “+” operator
substring() method return character of string based on the index the start index and end index
String Split() method is used to detach or split string by the given expression and is stored in String Array
this method is use to check if the string is empty or not and return bollean value if not empty then False or if empty then True.
The join method returns a new formed string from the string array and the character that is to joined with.
The method return boolean to find the character sequence in a string if character is available it will return true and if not then False.
Trim() method is used to remove leading and trailing space in a string.
The toUpperCase() is to change all String character to upper case.
The toLowerCase() is to change all String character to lower case.
KNOWLEDGE2LIFE
Knowledge2life
The Replace method is use to replace the substring with another substring or character.
The equals() method return boolean value based on the two string it compares the character of both string and if they are same the returns True and if not the False
The endsWith() method also returns a boolean type whenever the suffix matches the end of the string it returns True and False
Knowletge2life
True
False
True
Knowledge2life
|