- //判断某字符串数组中是否包含指定字符串
- public static boolean isHave(String[] strs,String s) {
- for(int i=0;i<strs.length;i++) {
- //循环查找字符串数组中的每个字符串中是否包含所有查找的内容
- if(strs[i].indexOf(s)!=-1) {
- return true;
- }
- }
- return false;
- }
- //该片段来自于http://www.codesnippet.cn/detail/1304201512218.html
来源: http://www.codesnippet.cn/detail/1304201512218.html