字符串学习
1.定义
概念:
注意
2.常用方法
str.charAt(index); 获取指定位置的字符

a.indexOf(substr); 获取字符串索引位置

str.startsWith(prefix);判断字符串是否以指定前缀开始

str.endsWith(suffix);判断字符串是否以指定后缀结束

str.toCharArray();获取字符串数组

str.contains(string) 判断字符串是否存在

str.substring(beginIndex);
str.substrinig(beginIndex,endIndex); 截取字符串






网友评论