Strings are objects which represent immutable arrays of characters.
Public Member Functions | |
String () | |
Answers an empty string. | |
String (byte[] data) | |
Converts the byte array to a String using the default encoding as specified by the file.encoding system property. | |
String (byte[] data, int high) | |
Converts the byte array to a String, setting the high byte of every character to the specified value. | |
String (byte[] data, int start, int length) | |
Converts the byte array to a String using the default encoding as specified by the file.encoding system property. | |
String (byte[] data, int high, int start, int length) | |
Converts the byte array to a String, setting the high byte of every character to the specified value. | |
String (byte[] data, int start, int length, final String encoding) throws UnsupportedEncodingException | |
Converts the byte array to a String using the specified encoding. | |
String (byte[] data, String encoding) throws UnsupportedEncodingException | |
Converts the byte array to a String using the specified encoding. | |
String (char[] data) | |
Initializes this String to contain the characters in the specified character array. | |
String (char[] data, int start, int length) | |
Initializes this String to contain the specified characters in the character array. | |
String (String string) | |
Creates a string that is a copy of another string. | |
String (StringBuffer stringbuffer) | |
Creates a string from the contents of a StringBuffer. | |
char | charAt (int index) |
Answers the character at the specified offset in this String. | |
int | compareTo (Object object) |
Compare the receiver to the specified Object to determine the relative ordering. | |
int | compareTo (String string) |
Compares the specified String to this String using the Unicode values of the characters. | |
int | compareToIgnoreCase (String string) |
Compare the receiver to the specified String to determine the relative ordering when the case of the characters is ignored. | |
String | concat (String string) |
Concatenates this String and the specified string. | |
boolean | endsWith (String suffix) |
Compares the specified string to this String to determine if the specified string is a suffix. | |
boolean | equals (Object object) |
Compares the specified object to this String and answer if they are equal. | |
boolean | equalsIgnoreCase (String string) |
Compares the specified String to this String ignoring the case of the characters and answer if they are equal. | |
byte[] | getBytes () |
Converts this String to a byte encoding using the default encoding as specified by the file.encoding sytem property. | |
void | getBytes (int start, int end, byte[] data, int index) |
Converts this String to a byte array, ignoring the high order bits of each character. | |
byte[] | getBytes (String encoding) throws UnsupportedEncodingException |
Converts this String to a byte encoding using the specified encoding. | |
void | getChars (int start, int end, char[] buffer, int index) |
Copies the specified characters in this String to the character array starting at the specified offset in the character array. | |
int | hashCode () |
Answers an integer hash code for the receiver. | |
int | indexOf (int c) |
Searches in this String for the first index of the specified character. | |
int | indexOf (int c, int start) |
Searches in this String for the index of the specified character. | |
int | indexOf (String string) |
Searches in this String for the first index of the specified string. | |
int | indexOf (String subString, int start) |
Searches in this String for the index of the specified string. | |
native String | intern () |
Only this native must be implemented, the implementation for the rest of this class is provided. | |
int | lastIndexOf (int c) |
Searches in this String for the last index of the specified character. | |
int | lastIndexOf (int c, int start) |
Searches in this String for the index of the specified character. | |
int | lastIndexOf (String string) |
Searches in this String for the last index of the specified string. | |
int | lastIndexOf (String subString, int start) |
Searches in this String for the index of the specified string. | |
int | length () |
Answers the size of this String. | |
boolean | regionMatches (int thisStart, String string, int start, int length) |
Compares the specified string to this String and compares the specified range of characters to determine if they are the same. | |
boolean | regionMatches (boolean ignoreCase, int thisStart, String string, int start, int length) |
Compares the specified string to this String and compares the specified range of characters to determine if they are the same. | |
String | replace (char oldChar, char newChar) |
Copies this String replacing occurrences of the specified character with another character. | |
boolean | startsWith (String prefix) |
Compares the specified string to this String to determine if the specified string is a prefix. | |
boolean | startsWith (String prefix, int start) |
Compares the specified string to this String, starting at the specified offset, to determine if the specified string is a prefix. | |
String | substring (int start) |
Copies a range of characters into a new String. | |
String | substring (int start, int end) |
Copies a range of characters into a new String. | |
char[] | toCharArray () |
Copies the characters in this String to a character array. | |
String | toLowerCase () |
Converts the characters in this String to lowercase, using the default Locale. | |
String | toLowerCase (Locale locale) |
Converts the characters in this String to lowercase, using the specified Locale. | |
String | toString () |
Answers a string containing a concise, human-readable description of the receiver. | |
String | toUpperCase () |
Converts the characters in this String to uppercase, using the default Locale. | |
String | toUpperCase (Locale locale) |
Converts the characters in this String to uppercase, using the specified Locale. | |
String | trim () |
Copies this String removing white space characters from the beginning and end of the string. | |
boolean | contentEquals (StringBuffer strbuf) |
Answers whether the characters in the StringBuffer strbuf are the same as those in this String. | |
boolean | matches (String expr) |
Determines whether a this String matches a given regular expression. | |
String | replaceAll (String expr, String substitute) |
Replace any substrings within this String that match the supplied regular expression expr, with the String substitute. | |
String | replaceFirst (String expr, String substitute) |
Replace any substrings within this String that match the supplied regular expression expr, with the String substitute. | |
String[] | split (String expr) |
Replace any substrings within this String that match the supplied regular expression expr, with the String substitute. | |
String[] | split (String expr, int max) |
Splits this String using the supplied regular expression expr. | |
CharSequence | subSequence (int start, int end) |
Has the same result as the substring function, but is present so that String may implement the CharSequence interface. | |
Static Public Member Functions | |
static String | copyValueOf (char[] data) |
Creates a new String containing the characters in the specified character array. | |
static String | copyValueOf (char[] data, int start, int length) |
Creates a new String containing the specified characters in the character array. | |
static String | valueOf (char[] data) |
Creates a new String containing the characters in the specified character array. | |
static String | valueOf (char[] data, int start, int length) |
Creates a new String containing the specified characters in the character array. | |
static String | valueOf (char value) |
Converts the specified character to its string representation. | |
static String | valueOf (double value) |
Converts the specified double to its string representation. | |
static String | valueOf (float value) |
Converts the specified float to its string representation. | |
static String | valueOf (int value) |
Converts the specified integer to its string representation. | |
static String | valueOf (long value) |
Converts the specified long to its string representation. | |
static String | valueOf (Object value) |
Converts the specified object to its string representation. | |
static String | valueOf (boolean value) |
Converts the specified boolean to its string representation. | |
Static Public Attributes | |
static final Comparator | CASE_INSENSITIVE_ORDER = new CaseInsensitiveComparator() |
Package Functions | |
String (int start, int length, char[] data) | |
char[] | getValue () |
Static Package Functions | |
[static initializer] | |
Static Package Attributes | |
static final long | serialVersionUID = -6849794470754667710L |
Private Member Functions | |
String (String s, char c) | |
String (String s1, int v1) | |
int | upperIndex (int ch) |
Return the index of the specified character into the upperValues table. | |
Static Private Member Functions | |
static int | indexOf (String haystackString, String needleString, int cache, int md2, char lastChar) |
Private Attributes | |
final char[] | value |
final int | offset |
final int | count |
int | hashCode |
Static Private Attributes | |
static final char[] | ascii |
static final char[] | upperValues = "SS\u0000\u02bcN\u0000J\u030c\u0000\u0399\u0308\u0301\u03a5\u0308\u0301\u0535\u0552\u0000H\u0331\u0000T\u0308\u0000W\u030a\u0000Y\u030a\u0000A\u02be\u0000\u03a5\u0313\u0000\u03a5\u0313\u0300\u03a5\u0313\u0301\u03a5\u0313\u0342\u1f08\u0399\u0000\u1f09\u0399\u0000\u1f0a\u0399\u0000\u1f0b\u0399\u0000\u1f0c\u0399\u0000\u1f0d\u0399\u0000\u1f0e\u0399\u0000\u1f0f\u0399\u0000\u1f08\u0399\u0000\u1f09\u0399\u0000\u1f0a\u0399\u0000\u1f0b\u0399\u0000\u1f0c\u0399\u0000\u1f0d\u0399\u0000\u1f0e\u0399\u0000\u1f0f\u0399\u0000\u1f28\u0399\u0000\u1f29\u0399\u0000\u1f2a\u0399\u0000\u1f2b\u0399\u0000\u1f2c\u0399\u0000\u1f2d\u0399\u0000\u1f2e\u0399\u0000\u1f2f\u0399\u0000\u1f28\u0399\u0000\u1f29\u0399\u0000\u1f2a\u0399\u0000\u1f2b\u0399\u0000\u1f2c\u0399\u0000\u1f2d\u0399\u0000\u1f2e\u0399\u0000\u1f2f\u0399\u0000\u1f68\u0399\u0000\u1f69\u0399\u0000\u1f6a\u0399\u0000\u1f6b\u0399\u0000\u1f6c\u0399\u0000\u1f6d\u0399\u0000\u1f6e\u0399\u0000\u1f6f\u0399\u0000\u1f68\u0399\u0000\u1f69\u0399\u0000\u1f6a\u0399\u0000\u1f6b\u0399\u0000\u1f6c\u0399\u0000\u1f6d\u0399\u0000\u1f6e\u0399\u0000\u1f6f\u0399\u0000\u1fba\u0399\u0000\u0391\u0399\u0000\u0386\u0399\u0000\u0391\u0342\u0000\u0391\u0342\u0399\u0391\u0399\u0000\u1fca\u0399\u0000\u0397\u0399\u0000\u0389\u0399\u0000\u0397\u0342\u0000\u0397\u0342\u0399\u0397\u0399\u0000\u0399\u0308\u0300\u0399\u0308\u0301\u0399\u0342\u0000\u0399\u0308\u0342\u03a5\u0308\u0300\u03a5\u0308\u0301\u03a1\u0313\u0000\u03a5\u0342\u0000\u03a5\u0308\u0342\u1ffa\u0399\u0000\u03a9\u0399\u0000\u038f\u0399\u0000\u03a9\u0342\u0000\u03a9\u0342\u0399\u03a9\u0399\u0000FF\u0000FI\u0000FL\u0000FFIFFLST\u0000ST\u0000\u0544\u0546\u0000\u0544\u0535\u0000\u0544\u053b\u0000\u054e\u0546\u0000\u0544\u053d\u0000".value |
Classes | |
class | CaseInsensitiveComparator |
CaseInsensitiveComparator compares Strings ignoring the case of the characters. More... | |
class | ConsolePrintStream |
An PrintStream used for System.out which performs the correct character conversion for the console, since the console may use a different conversion than the default file.encoding. More... |
|
Answers an empty string.
|
|
Converts the byte array to a String using the default encoding as specified by the file.encoding system property. If the system property is not defined, the default encoding is ISO8859_1 (ISO-Latin-1). If 8859-1 is not available, an ASCII encoding is used.
|
|
Converts the byte array to a String, setting the high byte of every character to the specified value.
|
|
Converts the byte array to a String using the default encoding as specified by the file.encoding system property. If the system property is not defined, the default encoding is ISO8859_1 (ISO-Latin-1). If 8859-1 is not available, an ASCII encoding is used.
|
|
Converts the byte array to a String, setting the high byte of every character to the specified value.
|
|
Converts the byte array to a String using the specified encoding.
|
|
Converts the byte array to a String using the specified encoding.
|
|
Initializes this String to contain the characters in the specified character array. Modifying the character array after creating the String has no effect on the String.
|
|
Initializes this String to contain the specified characters in the character array. Modifying the character array after creating the String has no effect on the String.
|
|
Creates a string that is a copy of another string.
|
|
Creates a string from the contents of a StringBuffer.
|
|
Answers the character at the specified offset in this String.
|
|
Compare the receiver to the specified Object to determine the relative ordering.
|
|
Compares the specified String to this String using the Unicode values of the characters. Answer 0 if the strings contain the same characters in the same order. Answer a negative integer if the first non-equal character in this String has a Unicode value which is less than the Unicode value of the character at the same position in the specified string, or if this String is a prefix of the specified string. Answer a positive integer if the first non-equal character in this String has a Unicode value which is greater than the Unicode value of the character at the same position in the specified string, or if the specified String is a prefix of the this String.
|
|
Compare the receiver to the specified String to determine the relative ordering when the case of the characters is ignored.
|
|
Concatenates this String and the specified string.
|
|
Creates a new String containing the characters in the specified character array. Modifying the character array after creating the String has no effect on the String.
|
|
Creates a new String containing the specified characters in the character array. Modifying the character array after creating the String has no effect on the String.
|
|
Compares the specified string to this String to determine if the specified string is a suffix.
|
|
Compares the specified object to this String and answer if they are equal. The object must be an instance of String with the same characters in the same order.
|
|
Compares the specified String to this String ignoring the case of the characters and answer if they are equal.
|
|
Converts this String to a byte encoding using the default encoding as specified by the file.encoding sytem property. If the system property is not defined, the default encoding is ISO8859_1 (ISO-Latin-1). If 8859-1 is not available, an ASCII encoding is used.
|
|
Converts this String to a byte array, ignoring the high order bits of each character.
|
|
Converts this String to a byte encoding using the specified encoding.
|
|
Copies the specified characters in this String to the character array starting at the specified offset in the character array.
|
|
Answers an integer hash code for the receiver. Objects which are equal answer the same value for this method.
|
|
Searches in this String for the first index of the specified character. The search for the character starts at the beginning and moves towards the end of this String.
|
|
Searches in this String for the index of the specified character. The search for the character starts at the specified offset and moves towards the end of this String.
|
|
Searches in this String for the first index of the specified string. The search for the string starts at the beginning and moves towards the end of this String.
|
|
Searches in this String for the index of the specified string. The search for the string starts at the specified offset and moves towards the end of this String.
|
|
Only this native must be implemented, the implementation for the rest of this class is provided. Searches an internal table of strings for a string equal to this String. If the string is not in the table, it is added. Answers the string contained in the table which is equal to this String. The same string object is always answered for strings which are equal.
|
|
Searches in this String for the last index of the specified character. The search for the character starts at the end and moves towards the beginning of this String.
|
|
Searches in this String for the index of the specified character. The search for the character starts at the specified offset and moves towards the beginning of this String.
|
|
Searches in this String for the last index of the specified string. The search for the string starts at the end and moves towards the beginning of this String.
|
|
Searches in this String for the index of the specified string. The search for the string starts at the specified offset and moves towards the beginning of this String.
|
|
Answers the size of this String.
|
|
Compares the specified string to this String and compares the specified range of characters to determine if they are the same.
|
|
Compares the specified string to this String and compares the specified range of characters to determine if they are the same. When ignoreCase is true, the case of the characters is ignored during the comparison.
|
|
Copies this String replacing occurrences of the specified character with another character.
|
|
Compares the specified string to this String to determine if the specified string is a prefix.
|
|
Compares the specified string to this String, starting at the specified offset, to determine if the specified string is a prefix.
|
|
Copies a range of characters into a new String.
|
|
Copies a range of characters into a new String.
|
|
Copies the characters in this String to a character array.
|
|
Converts the characters in this String to lowercase, using the default Locale.
|
|
Converts the characters in this String to lowercase, using the specified Locale.
|
|
Answers a string containing a concise, human-readable description of the receiver.
|
|
Converts the characters in this String to uppercase, using the default Locale.
|
|
Return the index of the specified character into the upperValues table. The upperValues table contains three entries at each position. These three characters are the upper case conversion. If only two characters are used, the third character in the table is .
|
|
Converts the characters in this String to uppercase, using the specified Locale.
|
|
Copies this String removing white space characters from the beginning and end of the string.
|
|
Creates a new String containing the characters in the specified character array. Modifying the character array after creating the String has no effect on the String.
|
|
Creates a new String containing the specified characters in the character array. Modifying the character array after creating the String has no effect on the String.
|
|
Converts the specified character to its string representation.
|
|
Converts the specified double to its string representation.
|
|
Converts the specified float to its string representation.
|
|
Converts the specified integer to its string representation.
|
|
Converts the specified long to its string representation.
|
|
Converts the specified object to its string representation.
If the object is null answer the string
|
|
Converts the specified boolean to its string representation.
When the boolean is true answer
|
|
Answers whether the characters in the StringBuffer strbuf are the same as those in this String.
|
|
Determines whether a this String matches a given regular expression.
|
|
Replace any substrings within this String that match the supplied regular expression expr, with the String substitute.
|
|
Replace any substrings within this String that match the supplied regular expression expr, with the String substitute.
|
|
Replace any substrings within this String that match the supplied regular expression expr, with the String substitute.
|
|
Splits this String using the supplied regular expression expr. max controls the number of times that the pattern is applied to the string.
|
|
Has the same result as the substring function, but is present so that String may implement the CharSequence interface.
|