1. char charAt(int index)
  • 返回指定索引处的char值
  1. int compareTo(String anotherString)
  • 按字典顺序比较两个字符串
  1. int compareToIgnoreCase(String str)
  • 按字典顺序比较两个字符串,不考虑大小写
  1. String concat(String str)
  • 将指定字符串连接到此字符串的结尾
  1. boolean contains(CharSequence cs)
  •  当且仅当此字符串包含指定的char值序列时,返回true
  1. static String copyValurOf(char[] data)
  • 返回指定数组中表示该字符序列的String
  1. boolean endsWith(String suffix)
  • 测试此字符串是否以指定的后缀结束
  1. boolean equals(Object anObj)
  • 将此字符串与指定的对象比较
  1. boolean equalsIgnoreCase(String oString)
  • 将此String对象与另一个String比较,不考虑大小写。
  1. int length()
  • 返回此字符串的长度
  1. boolean matches(String regex)
  • 告知此字符串是否匹配给定的正则表达式
  1. String replace(char oldChar, char newChar)
  • newChar替换此字符串所有oldChar
  1. String replaceAll(String regex, String replacement)
  • 使用给定的replacement字符串替换此字符串所有匹配的给定的正则表达式的子字符串
  1. String[] split(String regex)
  • 根据给定的正则表达式匹配拆分此字符串
  1. boolean startsWith(String prefix)
  • 测试此字符串是否以指定的前缀开始
  • startWith(String prefix, int toffset)
    • 测试此字符串从指定索引开始的子字符串是否以指定前缀开始
  1. String substring(int beginIndex)
  • 返回一个新字符串,从位置beginIndex开始。
  • substring(int beginIndex, int endIndex)
    • 返回一个新字符串,截取从位置beginIndex开始到endIndex结束
  1. String toLowerCase()
  • 转小写
  • toUpperCase()
    • 转大写
  1. String trim()
  • 返回字符串的副本,忽略前导空白和尾部空白。
  1. String valueOf(Object object)
  • 其他类型转为字符串类型
   
扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄