java.lang.Object | +--java.lang.String
Constructor Summary | |
String()
Construct a new String by converting the specified array
of bytes using the specified character encoding. |
|
String(char[] value)
Allocates a new String that contains characters from
a subarray of the character array argument. |
|
String(String value)
Initializes a newly created String object so that it
represents the same sequence of characters as the argument; in other
words, the newly created string is a copy of the argument string. |
|
String(StringBuffer buffer)
Allocates a new string that contains the sequence of characters currently contained in the string buffer argument. |
Method Summary | |
char |
charAt(int index)
Compares this String to another Object. |
int |
compareTo(String anotherString)
Compares two strings lexicographically. |
int |
compareToIgnoreCase(String str)
Compares two strings lexicographically, ignoring case considerations. |
String |
concat(String str)
Returns a String that is equivalent to the specified character array. |
boolean |
endsWith(String suffix)
Compares this string to the specified object. |
boolean |
equalsIgnoreCase(String anotherString)
Returns a hashcode for this string. |
int |
indexOf(int ch)
Returns the index within this string of the first occurrence of the specified character, starting the search at the specified index. |
int |
indexOf(String str)
Returns a canonical representation for the string object. |
int |
lastIndexOf(int ch)
Returns the index within this string of the last occurrence of the specified character, searching backward starting at the specified index. |
int |
lastIndexOf(String str)
Returns the index within this string of the last occurrence of the specified substring. |
int |
length()
Returns a new string resulting from replacing all occurrences of oldChar in this string with newChar . |
boolean |
startsWith(String prefix)
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. |
char[] |
toCharArray()
Converts this string to a new character array. |
String |
toLowerCase()
This object (which is already a string!) is itself returned. |
String |
toUpperCase()
Converts all of the characters in this String to upper
case using the rules of the given locale. |
String |
trim()
|