String Manipulation
6. ) Manipulating Character Case
String class provides following methods to manipulate character
case in String.
String toUpperCase()
String toUpperCase(Locale locale)
String toLowerCase()
String toLowerCase(Locale locale)
Note : Original String object is returned if none of the characters
changed, otherwise new String object is constructed and returned.
7. ) Miscellaneous methods
String trim()
This method removes white space from the front and the end of a
String.
int length()
Returns length of the String.
String intern()
This method returns interned String object, if already present
in the String pool. Otherwise this String is added into the pool,
and then interned reference is returned.
|