List of utility methods to do String Contain
boolean | containsCharRef(String s) Determines if a string contains what looks like an html character reference. return characterReferencePattern.matcher(s).find();
|
boolean | containsIgnoreCase(String str, String query) same as String.contains, but ignores case. if (str != null && query != null) { int limit = str.length() - query.length() + 1; for (int i = 0; i < limit; i++) { if (matchesIgnoreCase(str, query, i)) { return true; return false; |
boolean | contains(String[] components, String value) contains if (components == null || value == null) { return false; for (String str : components) { if (str.equals(value)) { return true; return false; |
boolean | containChinese(String s) contain Chinese if (null == s) { return false; Pattern pattern = Pattern.compile(".*[\u4e00-\u9fbb]+.*"); Matcher matcher = pattern.matcher(s); return matcher.matches(); |
boolean | contains(final String str, final char ch) contains if (isEmpty(str)) { return false; return str.indexOf(ch) >= 0; |
boolean | contains(final String s1, final String s2) contains if (isEmpty(s1)) { return false; return s1.indexOf(s2) >= 0; |
boolean | contains(String target, String content) contains if (target.indexOf(content) != -1) { return true; return false; |