char charat(int index)
返回指定索引处的 char 值。
string concat(string str)
将指定字符串联到此字符串的结尾。
boolean contentequals(charsequence cs)
当且仅当此 string 表示与指定序列相同的 char 值时,才返回 true。
static string copyvalueof(char[] data)
返回指定数组中表示该字符序列的字符串。
static string copyvalueof(char[] data, int offset, int count)
boolean endswith(string suffix)
测试此字符串是否以指定的后缀结束。
boolean equals(object anobject)
比较此字符串与指定的对象。
boolean equalsignorecase(string anotherstring)
将此 string 与另一个 string 进行比较,不考虑大小写。
static string format(locale l, string format, object... args)
使用指定的语言环境、格式字符串和参数返回一个格式化字符串。
static string format(string format, object... args)
使用指定的格式字符串和参数返回一个格式化字符串。
byte[] getbytes()
使用平台默认的字符集将此 string 解码为字节序列,并将结果存储到一个新的字节数组中。
void getbytes(int srcbegin, int srcend, byte[] dst, int dstbegin)
已过时。 该方法无法将字符正确转换为字节。从 jdk 1.1 起,完成该转换的
int hashcode()
返回此字符串的哈希码。
int indexof(int ch)
返回指定字符在此字符串中第一次出现处的索引。
int lastindexof(int ch)
返回最后一次出现的指定字符在此字符串中的索引。
int length()
返回此字符串的长度。
string replace(char oldchar, char newchar)
返回一个新的字符串,它是通过用 newchar 替换此字符串中出现的所有 oldchar 而生成的。
string replace(charsequence target, charsequence replacement)
使用指定的字面值替换序列替换此字符串匹配字面值目标序列的每个子字符串。
string replaceall(string regex, string replacement)
使用给定的 replacement 字符串替换此字符串匹配给定的正则表达式的每个子字符串。
string replacefirst(string regex, string replacement)
使用给定的 replacement 字符串替换此字符串匹配给定的正则表达式的第一个子字符串。
string[] split(string regex)
根据给定的正则表达式的匹配来拆分此字符串。
boolean startswith(string prefix)
测试此字符串是否以指定的前缀开始。
string substring(int beginindex)
返回一个新的字符串,它是此字符串的一个子字符串。
char[] tochararray()
将此字符串转换为一个新的字符数组。
string tolowercase()
使用默认语言环境的规则将此 string 中的所有字符都转换为小写。
string tolowercase(locale locale)
使用给定 locale 的规则将此 string 中的所有字符都转换为小写。
string tostring()
返回此对象本身(它已经是一个字符串!)。
string touppercase()
使用默认语言环境的规则将此 string 中的所有字符都转换为大写。
string touppercase(locale locale)
使用给定的 locale 规则将此 string 中的所有字符都转换为大写。
string trim()
返回字符串的副本,忽略前导空白和尾部空白。
static string valueof(boolean b)
返回 boolean 参数的字符串表示形式。
static string valueof(char c)
返回 char 参数的字符串表示形式。