char charAt(int index) |
返回指定索引处的字符。 |
int compareTo(Object o) |
将此字符串与另一个对象进行比较。 |
int compareTo(String anotherString) |
按字典顺序比较两个字符串。 |
int compareToIgnoreCase(String str) |
按字典顺序比较两个字符串,忽略大小写差异。 |
String concat(String str) |
将指定的字符串连接到该字符串的末尾。 |
boolean contentEquals(StringBuffer sb) |
当且仅当此String表示与指定的StringBuffer相同的字符序列时,才返回true。 |
static String copyValueOf(char[] data) |
返回一个String,它表示指定数组中的字符序列。 |
static String copyValueOf(char[] data, int offset, int count) |
返回一个String,它表示指定数组中的字符序列。 |
boolean endsWith(String suffix) |
测试此字符串是否以指定的后缀结尾。 |
boolean equals(Object anObject) |
将此字符串与指定对象进行比较。 |
boolean equalsIgnoreCase(String anotherString) |
不考虑大小写考虑,将此字符串与另一个字符串进行比较。 |
byte getBytes() |
使用平台的默认字符集将此String编码为字节序列,并将结果存储到新的字节数组中。 |
byte[] getBytes(String charsetName) |
使用命名的字符集将此String编码为字节序列,并将结果存储到新的字节数组中。 |
void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) |
将字符串中的字符复制到目标字符数组中。 |
int hashCode() |
返回此字符串的哈希码。 |
int indexOf(int ch) |
返回指定字符首次出现在此字符串中的索引。 |
int indexOf(int ch, int fromIndex) |
返回第一次出现的指定字符在此字符串内的索引,从指定索引开始搜索。 |
int indexOf(String str) |
返回指定子字符串首次出现在该字符串中的索引。 |
int indexOf(String str, int fromIndex) |
从指定的索引开始,返回指定子字符串首次出现在该字符串中的索引。 |
String intern() |
返回字符串对象的规范表示。 |
int lastIndexOf(int ch) |
返回最后一次出现的指定字符在此字符串内的索引。 |
int lastIndexOf(int ch, int fromIndex) |
返回最后一次出现的指定字符在此字符串内的索引,从指定索引开始向后搜索。 |
int lastIndexOf(String str) |
返回此字符串内指定子字符串最右边出现的索引。 |
int lastIndexOf(String str, int fromIndex) |
返回最后一次出现的指定子字符串在此字符串内的索引,从指定索引开始向后搜索。 |
int length() |
返回此字符串的长度。 |
boolean matches(String regex) |
判断此字符串是否与给定的正则表达式匹配。 |
boolean regionMatches(boolean ignoreCase, int toffset, String other, int offset, int len) |
测试两个字符串区域是否相等。 |
boolean regionMatches(int toffset, String other, int offset, int len) |
测试两个字符串区域是否相等。 |
String replace(char oldChar, char newChar) |
返回一个新字符串,该字符串是用newChar替换此字符串中所有出现的oldChar的结果。 |
String replaceAll(String regex, String replacement) |
用给定的替换项替换该字符串中与给定的正则表达式匹配的每个子字符串。 |
String replaceFirst(String regex, String replacement) |
用给定的替换项替换与给定的正则表达式匹配的此字符串的第一个子字符串。 |
String[] split(String regex) |
围绕给定正则表达式的匹配项拆分此字符串。 |
String[] split(String regex, int limit) |
围绕给定正则表达式的匹配项拆分此字符串。 |
boolean startsWith(String prefix) |
测试此字符串是否以指定的前缀开头。 |
boolean startsWith(String prefix, int toffset) |
测试此字符串是否从以指定索引开头的指定前缀开始。 |
CharSequence subSequence(int beginIndex, int endIndex) |
返回一个新的字符序列,该序列是该序列的子序列。 |
String substring(int beginIndex) |
返回一个新字符串,该字符串是该字符串的子字符串。 |
String substring(int beginIndex, int endIndex) |
返回一个新字符串,该字符串是该字符串的子字符串。 |
char[] toCharArray() |
将此字符串转换为新的字符数组。 |
String toLowerCase() |
使用默认语言环境的规则将此String中的所有字符转换为小写。 |
String toLowerCase(Locale locale) |
使用给定语言环境的规则将此String中的所有字符转换为小写。 |
String toString() 该对象[已经是字符串!] |
本身将返回。 |
String toUpperCase() |
使用默认语言环境的规则将此String中的所有字符转换为大写。 |
String toUpperCase(Locale locale) |
使用给定Locale的规则将此String中的所有字符转换为大写。 |
String trim() |
返回字符串的副本,省略前导和尾随空格。 |
static String valueOf(primitive data type x) |
返回传递的数据类型参数的字符串表示形式 |