|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
waba.lang.Object | +--waba.lang.String
String is an array of characters.
As with all classes in the waba.lang package, you can't reference the String class using the full specifier of waba.lang.String. The waba.lang package is implicitly imported. Instead, you should simply access the String class like this:
String s = new String("Hello");
Constructor Summary | |
|
String()
Creates an empty string. |
|
String(char[] c)
Creates a string from the given character array. |
|
String(char[] c,
int offset,
int count)
Creates a string from a portion of the given character array. |
|
String(String s)
Creates a copy of the given string. |
protected |
String(String[] s,
int count)
Creates a string from an array of strings. |
Method Summary | |
char |
charAt(int i)
Returns the character at the given position. |
String |
concat(String s)
Concatenates the given string to this string and returns the result. |
boolean |
equals(Object obj)
Returns true if the given string is equal to this string and false otherwise. |
int |
length()
Returns the length of the string in characters. |
String |
substring(int start,
int end)
Returns a substring of the string. |
char[] |
toCharArray()
Returns this string as a character array. |
String |
toString()
Returns this string. |
static String |
valueOf(boolean b)
Converts the given boolean to a String. |
static String |
valueOf(char c)
Converts the given char to a String. |
static String |
valueOf(float f)
Converts the given float to a String. |
static String |
valueOf(int i)
Converts the given int to a String. |
static String |
valueOf(Object obj)
Returns the string representation of the given object. |
Constructor Detail |
public String()
protected String(String[] s, int count)
public String(String s)
public String(char[] c)
public String(char[] c, int offset, int count)
c
- the character arrayoffset
- the position of the first character in the arraycount
- the number of charactersMethod Detail |
public int length()
public char charAt(int i)
public String concat(String s)
public char[] toCharArray()
public static String valueOf(boolean b)
public static String valueOf(char c)
public static String valueOf(int i)
public static String valueOf(float f)
public String toString()
public static String valueOf(Object obj)
public String substring(int start, int end)
string.substring(4, 6);a string created from characters 4 and 5 will be returned.
start
- the first character of the substringend
- the character after the last character of the substringpublic boolean equals(Object obj)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |