String的startWith()和endWith()

1.startWith()

语法:startWith(String prefix, int toffset)判断字符串是不是以什么开头

prefix:指定的前缀

toffset:在字符串中查找的位置,可以省略,省略就从第一个下标开始查找

2.endWith(String prefix, int toffset)判断字符串是不是以什么结尾

原文地址:https://www.cnblogs.com/-scl/p/7420006.html