PHP短视频源码,java中ArrayList模糊查询
//原数据
private Lsit mDataList = new ArrayList();
//模糊搜索后的数据
private List mSearchResult = new ArrayList();
private List fuzzySearch(String text) {
if (mDataList == null) {
return mSearchResult;
}
//防止输入括号时抛异常
String patten = Pattern.quote("" + text);
//不区分大小写
Pattern pattern = Pattern.compile(patten, Pattern.CASE_INSENSITIVE);
//区分大小写
//Pattern pattern = Pattern.compile(patten);
mSearchResult.clear();
for (int i = 0; i
Matcher matcher = pattern.matcher(mDataList.get(i).getPassportEnclosureInfo().getForeignId());
if (matcher.find()) {
mSearchResult.add(mDataList.get(i));
}
}
return mSearchResult;
}
以上就是
PHP短视频源码,java中ArrayList模糊查询,更多内容欢迎关注之后的文章