|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.String
String is an array of characters.
As with all classes in the ewe.lang package, you can't reference the String class using the full specifier of ewe.lang.String. The ewe.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(byte[] utf8Bytes)
|
|
String(byte[] utf8Bytes,
int start,
int length)
|
|
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. |
|
String(StringBuffer buffer)
|
|
| Method Summary | |
char |
charAt(int i)
Returns the character at the given position. |
int |
compareTo(String other)
|
String |
concat(String s)
Concatenates the given string to this string and returns the result. |
static String |
copyValueOf(char[] data)
|
static String |
copyValueOf(char[] data,
int start,
int length)
|
boolean |
endsWith(String other)
|
boolean |
equals(Object obj)
Returns if this object is considered equal to the other object. |
boolean |
equalsIgnoreCase(String other)
|
byte[] |
getBytes()
Convert the characters into bytes according to the default enocoding format. |
void |
getChars(int srcBegin,
int srcEnd,
char[] dst,
int dstBegin)
|
int |
hashCode()
Returns a hashCode for the object. |
int |
indexOf(int ch)
|
int |
indexOf(int ch,
int start)
|
int |
indexOf(String other)
|
int |
indexOf(String other,
int start)
|
int |
lastIndexOf(int ch)
|
int |
lastIndexOf(int ch,
int start)
|
int |
lastIndexOf(String other)
|
int |
lastIndexOf(String other,
int start)
|
int |
length()
Returns the length of the string in characters. |
boolean |
regionMatches(boolean ignoreCase,
int toffset,
String other,
int oofset,
int len)
|
boolean |
regionMatches(int toffset,
String other,
int oofset,
int len)
|
String |
replace(char oldChar,
char newChar)
|
boolean |
startsWith(String prefix)
Returns true if the given string is equal to this string and false otherwise. |
boolean |
startsWith(String prefix,
int offset)
|
String |
substring(int start)
Get a substring from the specified index to the end of the string. |
String |
substring(int start,
int end)
Returns a substring of the string. |
char[] |
toCharArray()
Returns this string as a character array. |
String |
toLowerCase()
|
String |
toString()
Returns this string. |
String |
toUpperCase()
|
String |
trim()
|
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(char[] data)
|
static String |
valueOf(char[] data,
int start,
int length)
|
static String |
valueOf(double d)
|
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(long l)
|
static String |
valueOf(Object obj)
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass |
| Constructor Detail |
public String()
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 characterspublic String(byte[] utf8Bytes)
public String(byte[] utf8Bytes,
int start,
int length)
public String(StringBuffer buffer)
| Method Detail |
public int length()
public char charAt(int i)
public String concat(String s)
public char[] toCharArray()
public void getChars(int srcBegin,
int srcEnd,
char[] dst,
int dstBegin)
public static String copyValueOf(char[] data,
int start,
int length)
public static String copyValueOf(char[] data)
public static String valueOf(char[] data)
public static String valueOf(char[] data,
int start,
int length)
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 static String valueOf(double d)
public static String valueOf(long l)
public static String valueOf(Object obj)
public String toString()
toString in class Object
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 String substring(int start)
public boolean startsWith(String prefix)
public boolean startsWith(String prefix,
int offset)
public String replace(char oldChar,
char newChar)
public boolean equals(Object obj)
Object
equals in class Objectobj - Another object to compare to.
public boolean equalsIgnoreCase(String other)
public boolean endsWith(String other)
public int indexOf(String other)
public int indexOf(String other,
int start)
public int lastIndexOf(String other)
public int lastIndexOf(String other,
int start)
public int indexOf(int ch)
public int indexOf(int ch,
int start)
public int lastIndexOf(int ch)
public int lastIndexOf(int ch,
int start)
public int compareTo(String other)
public String trim()
public String toUpperCase()
public String toLowerCase()
public int hashCode()
Object
hashCode in class Object
public boolean regionMatches(boolean ignoreCase,
int toffset,
String other,
int oofset,
int len)
public boolean regionMatches(int toffset,
String other,
int oofset,
int len)
public byte[] getBytes()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||