Android Utililty Methods String Contain

List of utility methods to do String Contain

Description

The list of methods to do String Contain are organized into topic(s).

Method

booleancontainsCharRef(String s)
Determines if a string contains what looks like an html character reference.
return characterReferencePattern.matcher(s).find();
booleancontainsIgnoreCase(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;
booleancontains(String[] components, String value)
contains
if (components == null || value == null) {
    return false;
for (String str : components) {
    if (str.equals(value)) {
        return true;
return false;
booleancontainChinese(String s)
contain Chinese
if (null == s) {
    return false;
Pattern pattern = Pattern.compile(".*[\u4e00-\u9fbb]+.*");
Matcher matcher = pattern.matcher(s);
return matcher.matches();
booleancontains(final String str, final char ch)
contains
if (isEmpty(str)) {
    return false;
return str.indexOf(ch) >= 0;
booleancontains(final String s1, final String s2)
contains
if (isEmpty(s1)) {
    return false;
return s1.indexOf(s2) >= 0;
booleancontains(String target, String content)
contains
if (target.indexOf(content) != -1) {
    return true;
return false;