String Methods

Return
Value
Method Functionality
String  toUpperCase( ) Converts all of the characters in this String to upper case using the rules of the default locale.
String  toLowerCase( ) Converts all of the characters in this String to lower case using the rules of the default locale.
String  substring(int beginIndex) Returns a new string that is a substring of this string. 
String  substring(int beginIndex, int endIndex) Returns a new string that is a substring of this string.
It is important to note that the character at the endIndex position is not taken as part of the substring.
String  concat(String str) Concatenates the specified string to the end of this string.
char  charAt(int index) Returns the character at the specified index.
boolean  equals(Object anObject) Compares this string to the specified object.
boolean  equalsIgnoreCase(String anotherString) Compares this String to another String, ignoring case considerations.
int  length( ) Returns the length of this string.
String trim( ) Returns a copy of the string, with leading and trailing whitespace omitted.
int indexOf(String str) Returns the index within this string of the first occurrence of the specified substring.
String  replace(char oldChar, char newChar) Returns a new string resulting from replacing all occurrences of oldChar in this string with newChar.


- - - - - - - - -Strings are immutable.- - - - - - - -