常用方法整理
以下是常用方法的整理,详情代码如下
1: char charAt(int index)//返回指定index处的char值
2: String concat(string str)//将指定的字符串str连接到当前字符串的末尾并返回此新字符串对象
3: boolean contains(CharSequence s)此字符串对象是否包含指定的字符序列(一般可以认为是字符串)
4: boolean startsWith(String prefix)此字符串是否以指定的前缀开头
5: boolean endsWith(String sufx)此字符串是否以指定的后缀结尾
6: boolean equals(Object anObject)对比此字符串对象与指定对象的内容进行比对
7: boolean equalslgnoreCase(tring anotherstring)对比此字符串对象与指定内容进行忽略大小写的对比
8: int indexOf(int ch)返回指定字符在字符串对象中首次出现的索引
9: int indexOf(String str)返回指定字符串在字符串对象中首次出现的索引
10: int lstndexOf(int ch)返回指定字符在字符串对象中最后-次出现的索引
11: int latndexOf(tring str) 返回指定字符串在字符串对象中最后一次出现的索引
12: int length0返回此字符串的长度
13: boolean isEmpty0此字符串是否为空串
14: String replace(char oldChar char newChar)返回使用newChar替换oldChar之后的新String对象
15: String replace(CharSequence oldString, CharSequence newString)返回使用oldString替换newString之后的新String对象
16: Stringl sltString regex)按照给定的字符串或者正则表达式进行字符串的分割
18: String substrngint begindex)返回指定起始位置的字符串
19: Sting sustingint begindexint endIndex) 返回指定起始位置指定结束位置的字符串
20: String tolowerCase0返回此字符串的小写字符
21: String toUpperCase0返回此字符串的大写字符
22: String trim() 返回去掉字符串前后所有空格的新字符串
23: static String valueOf(._J.将参数内容转换成String对象