1、indexOf():传递某个字符,返回指定字符的索引。
![](https://img-blog.csdnimg.cn/img_convert/c54218ddc1ea9a8e878b6dc976da6f21.png)
2、charAt():返回指定索引处的字符。
charAt(int index)方法 传递一个下标参数,返回字符串对应位置的字符
![](https://img-blog.csdnimg.cn/img_convert/1ce4ca4db0a2bf7442f3d1d65b5fa0b6.png)
3、replace():字符串替换。
用传递的字符或字符串,替代指定的字符或者字符串。
4、trim():去除字符串两端空白。
![](https://img-blog.csdnimg.cn/img_convert/4110dba780f94950d647b1716403de34.png)
5、split():分割字符串,返回一个分割后的字符串数组。
6、getBytes():返回字符串的 byte 类型数组。
使用平台的默认字符集将此 String 编码为 byte 序列,并将结果存储到一个新的 byte 数组中。
7、length():返回字符串长度。
![](https://img-blog.csdnimg.cn/img_convert/c5ed571ce99ce28ce321f82c19c4b6e1.png)
8、toLowerCase():将字符串转成小写字母。
9、toUpperCase():将字符串转成大写字符。
10、substring():截取字符串。
![](https://img-blog.csdnimg.cn/img_convert/b8971447267428fb2edd2347414fc9ad.png)
11、equals():字符串比较。区分大小写。
![](https://img-blog.csdnimg.cn/img_convert/49225e27490b3b497e8f40c8870856d4.png)