String的startWith()和endWith()

1.startWith()

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

prefix:指定的前缀

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

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

 

posted @ 2017-08-23 20:25  孟夏草木长  阅读(2550)  评论(0编辑  收藏  举报