Main Page | Class Hierarchy | Class List | Directories | Class Members | Related Pages

java.lang.String Class Reference

List of all members.

Detailed Description

The implementation of this class is provided, but the documented native must be provided by the vm vendor.

Strings are objects which represent immutable arrays of characters.

See also:
StringBuffer


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...


Constructor & Destructor Documentation

java.lang.String.String  ) 
 

Answers an empty string.

java.lang.String.String byte[]  data  ) 
 

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.

Parameters:
data the byte array to convert to a String
Exceptions:
NullPointerException when data is null
See also:
getBytes()

getBytes(int, int, byte[], int)

getBytes(String)

valueOf(boolean)

valueOf(char)

valueOf(char[])

valueOf(char[], int, int)

valueOf(double)

valueOf(float)

valueOf(int)

valueOf(long)

valueOf(Object)

java.lang.String.String byte[]  data,
int  high
 

Converts the byte array to a String, setting the high byte of every character to the specified value.

Parameters:
data the byte array to convert to a String
high the high byte to use
Exceptions:
NullPointerException when data is null
Deprecated:
Use String(byte[]) or String(byte[], String) instead

java.lang.String.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.

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.

Parameters:
data the byte array to convert to a String
start the starting offset in the byte array
length the number of bytes to convert
Exceptions:
IndexOutOfBoundsException when length < 0, start < 0 or start + length > data.length
NullPointerException when data is null
See also:
getBytes()

getBytes(int, int, byte[], int)

getBytes(String)

valueOf(boolean)

valueOf(char)

valueOf(char[])

valueOf(char[], int, int)

valueOf(double)

valueOf(float)

valueOf(int)

valueOf(long)

valueOf(Object)

java.lang.String.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.

Parameters:
data the byte array to convert to a String
high the high byte to use
start the starting offset in the byte array
length the number of bytes to convert
Exceptions:
IndexOutOfBoundsException when length < 0, start < 0 or start + length > data.length
NullPointerException when data is null
Deprecated:
Use String(byte[], int, int) instead

java.lang.String.String byte[]  data,
int  start,
int  length,
final String  encoding
throws UnsupportedEncodingException
 

Converts the byte array to a String using the specified encoding.

Parameters:
data the byte array to convert to a String
start the starting offset in the byte array
length the number of bytes to convert
encoding the encoding
Exceptions:
IndexOutOfBoundsException when length < 0, start < 0 or start + length > data.length
UnsupportedEncodingException when encoding is not supported
NullPointerException when data is null
See also:
getBytes()

getBytes(int, int, byte[], int)

getBytes(String)

valueOf(boolean)

valueOf(char)

valueOf(char[])

valueOf(char[], int, int)

valueOf(double)

valueOf(float)

valueOf(int)

valueOf(long)

valueOf(Object)

UnsupportedEncodingException

java.lang.String.String byte[]  data,
String  encoding
throws UnsupportedEncodingException
 

Converts the byte array to a String using the specified encoding.

Parameters:
data the byte array to convert to a String
encoding the encoding
Exceptions:
UnsupportedEncodingException when encoding is not supported
NullPointerException when data is null
See also:
getBytes()

getBytes(int, int, byte[], int)

getBytes(String)

valueOf(boolean)

valueOf(char)

valueOf(char[])

valueOf(char[], int, int)

valueOf(double)

valueOf(float)

valueOf(int)

valueOf(long)

valueOf(Object)

UnsupportedEncodingException

java.lang.String.String char[]  data  ) 
 

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.

Parameters:
data the array of characters
Exceptions:
NullPointerException when data is null

java.lang.String.String char[]  data,
int  start,
int  length
 

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.

Parameters:
data the array of characters
start the starting offset in the character array
length the number of characters to use
Exceptions:
IndexOutOfBoundsException when length < 0, start < 0 or start + length > data.length
NullPointerException when data is null

java.lang.String.String String  string  ) 
 

Creates a string that is a copy of another string.

Parameters:
string the String to copy

java.lang.String.String StringBuffer  stringbuffer  ) 
 

Creates a string from the contents of a StringBuffer.

Parameters:
stringbuffer the StringBuffer


Member Function Documentation

char java.lang.String.charAt int  index  ) 
 

Answers the character at the specified offset in this String.

Parameters:
index the zero-based index in this string
Returns:
the character at the index
Exceptions:
IndexOutOfBoundsException when index < 0 or index >= length()

int java.lang.String.compareTo Object  object  ) 
 

Compare the receiver to the specified Object to determine the relative ordering.

Parameters:
object an Object
Returns:
an int < 0 if this String is less than the specified String, 0 if they are equal, and > 0 if this String is greater
Exceptions:
ClassCastException when object is not a String

int java.lang.String.compareTo String  string  ) 
 

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.

Parameters:
string the string to compare
Returns:
0 if the strings are equal, a negative integer if this String is before the specified String, or a positive integer if this String is after the specified String
Exceptions:
NullPointerException when string is null

int java.lang.String.compareToIgnoreCase String  string  ) 
 

Compare the receiver to the specified String to determine the relative ordering when the case of the characters is ignored.

Parameters:
string a String
Returns:
an int < 0 if this String is less than the specified String, 0 if they are equal, and > 0 if this String is greater

String java.lang.String.concat String  string  ) 
 

Concatenates this String and the specified string.

Parameters:
string the string to concatenate
Returns:
a new String which is the concatenation of this String and the specified String
Exceptions:
NullPointerException if string is null

static String java.lang.String.copyValueOf char[]  data  )  [static]
 

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.

Parameters:
data the array of characters
Returns:
the new String
Exceptions:
NullPointerException if data is null

static String java.lang.String.copyValueOf char[]  data,
int  start,
int  length
[static]
 

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.

Parameters:
data the array of characters
start the starting offset in the character array
length the number of characters to use
Returns:
the new String
Exceptions:
IndexOutOfBoundsException if length < 0, start < 0 or start + length > data.length
NullPointerException if data is null

boolean java.lang.String.endsWith String  suffix  ) 
 

Compares the specified string to this String to determine if the specified string is a suffix.

Parameters:
suffix the string to look for
Returns:
true when the specified string is a suffix of this String, false otherwise
Exceptions:
NullPointerException if suffix is null

boolean java.lang.String.equals Object  object  ) 
 

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.

Parameters:
object the object to compare
Returns:
true if the specified object is equal to this String, false otherwise
See also:
hashCode

boolean java.lang.String.equalsIgnoreCase String  string  ) 
 

Compares the specified String to this String ignoring the case of the characters and answer if they are equal.

Parameters:
string the string to compare
Returns:
true if the specified string is equal to this String, false otherwise

byte [] java.lang.String.getBytes  ) 
 

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.

Returns:
the byte array encoding of this String
See also:
String

void java.lang.String.getBytes int  start,
int  end,
byte[]  data,
int  index
 

Converts this String to a byte array, ignoring the high order bits of each character.

Parameters:
start the starting offset of characters to copy
end the ending offset of characters to copy
data the destination byte array
index the starting offset in the byte array
Exceptions:
NullPointerException when data is null
IndexOutOfBoundsException when start < 0, end > length(), index < 0, end - start > data.length - index
Deprecated:
Use getBytes() or getBytes(String)

byte [] java.lang.String.getBytes String  encoding  )  throws UnsupportedEncodingException
 

Converts this String to a byte encoding using the specified encoding.

Parameters:
encoding the encoding
Returns:
the byte array encoding of this String
Exceptions:
UnsupportedEncodingException when the encoding is not supported
See also:
String

UnsupportedEncodingException

void java.lang.String.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.

Parameters:
start the starting offset of characters to copy
end the ending offset of characters to copy
buffer the destination character array
index the starting offset in the character array
Exceptions:
IndexOutOfBoundsException when start < 0, end > length(), start > end, index < 0, end - start > buffer.length - index
NullPointerException when buffer is null

int java.lang.String.hashCode  ) 
 

Answers an integer hash code for the receiver.

Objects which are equal answer the same value for this method.

Returns:
the receiver's hash
See also:
equals

int java.lang.String.indexOf int  c  ) 
 

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.

Parameters:
c the character to find
Returns:
the index in this String of the specified character, -1 if the character isn't found
See also:
lastIndexOf(int)

lastIndexOf(int, int)

lastIndexOf(String)

lastIndexOf(String, int)

int java.lang.String.indexOf int  c,
int  start
 

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.

Parameters:
c the character to find
start the starting offset
Returns:
the index in this String of the specified character, -1 if the character isn't found
See also:
lastIndexOf(int)

lastIndexOf(int, int)

lastIndexOf(String)

lastIndexOf(String, int)

int java.lang.String.indexOf String  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.

Parameters:
string the string to find
Returns:
the index in this String of the specified string, -1 if the string isn't found
Exceptions:
NullPointerException when string is null
See also:
lastIndexOf(int)

lastIndexOf(int, int)

lastIndexOf(String)

lastIndexOf(String, int)

int java.lang.String.indexOf String  subString,
int  start
 

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.

Parameters:
subString the string to find
start the starting offset
Returns:
the index in this String of the specified string, -1 if the string isn't found
Exceptions:
NullPointerException when string is null
See also:
lastIndexOf(int)

lastIndexOf(int, int)

lastIndexOf(String)

lastIndexOf(String, int)

native String java.lang.String.intern  ) 
 

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.

Returns:
the interned string equal to this String

int java.lang.String.lastIndexOf int  c  ) 
 

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.

Parameters:
c the character to find
Returns:
the index in this String of the specified character, -1 if the character isn't found
See also:
lastIndexOf(int)

lastIndexOf(int, int)

lastIndexOf(String)

lastIndexOf(String, int)

int java.lang.String.lastIndexOf int  c,
int  start
 

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.

Parameters:
c the character to find
start the starting offset
Returns:
the index in this String of the specified character, -1 if the character isn't found
See also:
lastIndexOf(int)

lastIndexOf(int, int)

lastIndexOf(String)

lastIndexOf(String, int)

int java.lang.String.lastIndexOf String  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.

Parameters:
string the string to find
Returns:
the index in this String of the specified string, -1 if the string isn't found
Exceptions:
NullPointerException when string is null
See also:
lastIndexOf(int)

lastIndexOf(int, int)

lastIndexOf(String)

lastIndexOf(String, int)

int java.lang.String.lastIndexOf String  subString,
int  start
 

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.

Parameters:
subString the string to find
start the starting offset
Returns:
the index in this String of the specified string, -1 if the string isn't found
Exceptions:
NullPointerException when string is null
See also:
lastIndexOf(int)

lastIndexOf(int, int)

lastIndexOf(String)

lastIndexOf(String, int)

int java.lang.String.length  ) 
 

Answers the size of this String.

Returns:
the number of characters in this String

boolean java.lang.String.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.

Parameters:
thisStart the starting offset in this String
string the string to compare
start the starting offset in string
length the number of characters to compare
Returns:
true if the ranges of characters is equal, false otherwise
Exceptions:
NullPointerException when string is null

boolean java.lang.String.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.

When ignoreCase is true, the case of the characters is ignored during the comparison.

Parameters:
ignoreCase specifies if case should be ignored
thisStart the starting offset in this String
string the string to compare
start the starting offset in string
length the number of characters to compare
Returns:
true if the ranges of characters is equal, false otherwise
Exceptions:
NullPointerException when string is null

String java.lang.String.replace char  oldChar,
char  newChar
 

Copies this String replacing occurrences of the specified character with another character.

Parameters:
oldChar the character to replace
newChar the replacement character
Returns:
a new String with occurrences of oldChar replaced by newChar

boolean java.lang.String.startsWith String  prefix  ) 
 

Compares the specified string to this String to determine if the specified string is a prefix.

Parameters:
prefix the string to look for
Returns:
true when the specified string is a prefix of this String, false otherwise
Exceptions:
NullPointerException when prefix is null

boolean java.lang.String.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.

Parameters:
prefix the string to look for
start the starting offset
Returns:
true when the specified string occurs in this String at the specified offset, false otherwise
Exceptions:
NullPointerException when prefix is null

String java.lang.String.substring int  start  ) 
 

Copies a range of characters into a new String.

Parameters:
start the offset of the first character
Returns:
a new String containing the characters from start to the end of the string
Exceptions:
IndexOutOfBoundsException when start < 0 or start > length()

String java.lang.String.substring int  start,
int  end
 

Copies a range of characters into a new String.

Parameters:
start the offset of the first character
end the offset one past the last character
Returns:
a new String containing the characters from start to end - 1
Exceptions:
IndexOutOfBoundsException when start < 0, start > end or end > length()

char [] java.lang.String.toCharArray  ) 
 

Copies the characters in this String to a character array.

Returns:
a character array containing the characters of this String

String java.lang.String.toLowerCase  ) 
 

Converts the characters in this String to lowercase, using the default Locale.

Returns:
a new String containing the lowercase characters equivalent to the characters in this String

String java.lang.String.toLowerCase Locale  locale  ) 
 

Converts the characters in this String to lowercase, using the specified Locale.

Parameters:
locale the Locale
Returns:
a new String containing the lowercase characters equivalent to the characters in this String

String java.lang.String.toString  ) 
 

Answers a string containing a concise, human-readable description of the receiver.

Returns:
this String

String java.lang.String.toUpperCase  ) 
 

Converts the characters in this String to uppercase, using the default Locale.

Returns:
a new String containing the uppercase characters equivalent to the characters in this String

int java.lang.String.upperIndex int  ch  )  [private]
 

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 .

Parameters:
ch the char being converted to upper case
Returns:
the index into the upperValues table, or -1

String java.lang.String.toUpperCase Locale  locale  ) 
 

Converts the characters in this String to uppercase, using the specified Locale.

Parameters:
locale the Locale
Returns:
a new String containing the uppercase characters equivalent to the characters in this String

String java.lang.String.trim  ) 
 

Copies this String removing white space characters from the beginning and end of the string.

Returns:
a new String with characters <= \u0020 removed from the beginning and the end

static String java.lang.String.valueOf char[]  data  )  [static]
 

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.

Parameters:
data the array of characters
Returns:
the new String
Exceptions:
NullPointerException when data is null

static String java.lang.String.valueOf char[]  data,
int  start,
int  length
[static]
 

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.

Parameters:
data the array of characters
start the starting offset in the character array
length the number of characters to use
Returns:
the new String
Exceptions:
IndexOutOfBoundsException when length < 0, start < 0 or start + length > data.length
NullPointerException when data is null

static String java.lang.String.valueOf char  value  )  [static]
 

Converts the specified character to its string representation.

Parameters:
value the character
Returns:
the character converted to a string

static String java.lang.String.valueOf double  value  )  [static]
 

Converts the specified double to its string representation.

Parameters:
value the double
Returns:
the double converted to a string

static String java.lang.String.valueOf float  value  )  [static]
 

Converts the specified float to its string representation.

Parameters:
value the float
Returns:
the float converted to a string

static String java.lang.String.valueOf int  value  )  [static]
 

Converts the specified integer to its string representation.

Parameters:
value the integer
Returns:
the integer converted to a string

static String java.lang.String.valueOf long  value  )  [static]
 

Converts the specified long to its string representation.

Parameters:
value the long
Returns:
the long converted to a string

static String java.lang.String.valueOf Object  value  )  [static]
 

Converts the specified object to its string representation.

If the object is null answer the string "null", otherwise use toString() to get the string representation.

Parameters:
value the object
Returns:
the object converted to a string

static String java.lang.String.valueOf boolean  value  )  [static]
 

Converts the specified boolean to its string representation.

When the boolean is true answer "true", otherwise answer "false".

Parameters:
value the boolean
Returns:
the boolean converted to a string

boolean java.lang.String.contentEquals StringBuffer  strbuf  ) 
 

Answers whether the characters in the StringBuffer strbuf are the same as those in this String.

Parameters:
strbuf the StringBuffer to compare this String to
Returns:
true when the characters in strbuf are identical to those in this String. If they are not, false will be returned.
Exceptions:
NullPointerException when strbuf is null
Since:
1.4

boolean java.lang.String.matches String  expr  ) 
 

Determines whether a this String matches a given regular expression.

Parameters:
expr the regular expression to be matched
Returns:
true if the expression matches, otherwise false
Exceptions:
PatternSyntaxException if the syntax of the supplied regular expression is not valid
NullPointerException if expr is null
Since:
1.4

String java.lang.String.replaceAll String  expr,
String  substitute
 

Replace any substrings within this String that match the supplied regular expression expr, with the String substitute.

Parameters:
expr the regular expression to match
substitute the string to replace the matching substring with
Returns:
the new string
Exceptions:
NullPointerException if expr is null
Since:
1.4

String java.lang.String.replaceFirst String  expr,
String  substitute
 

Replace any substrings within this String that match the supplied regular expression expr, with the String substitute.

Parameters:
expr the regular expression to match
substitute the string to replace the matching substring with
Returns:
the new string
Exceptions:
NullPointerException if expr is null
Since:
1.4

String [] java.lang.String.split String  expr  ) 
 

Replace any substrings within this String that match the supplied regular expression expr, with the String substitute.

Parameters:
expr the regular expression to match
Returns:
the new string
Exceptions:
NullPointerException if expr is null
Since:
1.4

String [] java.lang.String.split String  expr,
int  max
 

Splits this String using the supplied regular expression expr.

max controls the number of times that the pattern is applied to the string.

Parameters:
expr the regular expression used to divide the string
max the number of times to apply the pattern
Returns:
an array of Strings created by separating the string along matches of the regular expression.
Exceptions:
NullPointerException if expr is null
Since:
1.4

CharSequence java.lang.String.subSequence int  start,
int  end
 

Has the same result as the substring function, but is present so that String may implement the CharSequence interface.

Parameters:
start the offset the first character
end the offset of one past the last character to include
Returns:
the subsequence requested
Exceptions:
IndexOutOfBoundsException when start or end is less than zero, start is greater than end, or end is greater than the length of the String.
See also:
java.lang.CharSequence.subSequence(int, int)
Since:
1.4


The documentation for this class was generated from the following file:
(c) Copyright 2005 The Apache Software Foundation or its licensors, as applicable.