Literal form: "", "abc","32", "Hi there!", etc.
Parameters: chs - the array of characters used to build this String.
char charAt(int i)
Parameters: i - the index in this String for which we want the char value.
Returns: the char value at index i.
Throws: IndexOutOfBoundsException, if i is out of range for this String
Note: As with array indexing, the first char value of the sequence is at index 0, the next at index 1, and so on, up to the last character at index (length() - 1).
int compareTo(String s)
Parameters: s - the other String with which we are comparing this one.
Returns: a negative integer, if this String lexicographically precedes s; a positive integer, if it follows s, and 0, if the this String and sare equal.
Note:The result is 0 exactly when the equals() method would return true.
String concat(String s)
Parameters: s - the String that is concatenated to the end of this String
Returns: a string that represents the concatenation of this object's characters followed by the s's characters.
Note: Essentially equivalent to the + operator. E.g., "a.concat(b)" is the same thing as "a + b", unless a == null.
boolean equals(Object obj)
Parameters: obj - any object
Returns: The result is true if and only if obj is not null and is a String object that represents the same sequence of characters as this object.
Note: As with all objects, you should usually use this method to check for equality, rather than the == operator.
int indexOf(String s)
Parameters: s - any string
Returns: the index within this string of the first character of the first occurrence of s, or -1, if s is not contained in this String.
Note: See also lastIndexOf()
Returns: the number of characters in this string.
int lastIndexOf(String s)
Parameters: s - any string
Returns: the index within this string of the first character of the last occurrence of s, or -1, if s is not contained in this String.
Note: See also indexOf()
String split(String delimPattern)
Parameters: delimPattern - the pattern used to delimit tokens within this String
Returns: the array of strings computed by splitting this String around matches of the given pattern
Note: The following are some useful delimiter patterns:
> "\\s+" whitespace > "\\W+" any sequence of non-alphanumeric characters (dual to "\\w+") > "\\w+" any sequence of alphanumeric characters (dual to "\\W+")
String substring(int i, int j)
Parameters: i - the beginning index, inclusive.
j - the ending index, exclusive.
Returns: Returns a new string that is a substring of this string. The substring begins at the specified index, i and extends to the character at index j- 1.
Throws: IndexOutOfBoundsException, if either i or j is out of range for this String, or if i>j
Note: Thus the length of the substring is j-i.
Returns: a newly allocated character array whose length is the length of this string and whose contents are initialized to contain the character sequence represented by this string.
Returns: A copy of this String, converted to lowercase.
Returns: A copy of this String, converted to uppercase.
Returns:a copy of this String, with leading and trailing whitespace omitted.
John H. E. Lasseter