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

booleancontains(String str1, String str2)
contains
return str1 != null && str1.contains(str2);
booleancheckContainSpace(final String x)
Check string for containing space.
return !(x != null && x.contains(SPACE));
booleancontainsCharRef(String s)
Determines if a string contains what looks like an html character reference.
return characterReferencePattern.matcher(s).find();
booleancontains(final CharSequence seq, final CharSequence searchSeq)
contains
if (seq == null || searchSeq == null) {
    return false;
return seq.toString().indexOf(searchSeq.toString()) >= 0;
intcontainCount(String str, String searchStr)
contain Count
int i = 0;
int idx = 0;
if (str == null || searchStr == null) {
    return 0;
while (true) {
    if ((idx = str.indexOf(searchStr)) > INDEX_NOT_FOUND) {
        str = substring(str, (idx + searchStr.length()),
...
booleancontains(String str, String searchStr)
contains
if (str == null || searchStr == null) {
    return false;
return str.indexOf(searchStr) > INDEX_NOT_FOUND;
booleancontains(String[] str, String searchStr)
contains
boolean val = false;
if (str == null || searchStr == null) {
    return val;
for (String s : str) {
    if (StringUtil.equals(s, searchStr)) {
        val = true;
        break;
...
booleancontains(String str, List keywords)
contains
if (str == null || keywords == null) {
    return false;
for (String key : keywords) {
    if (contains(str, key)) {
        return true;
return false;
StringcutWords(String src, String contains)
cut Words
int begin = src.indexOf(contains);
if (begin == -1) {
    return src;
int end = begin + contains.length();
String beginStr = "";
if (begin != 0) {
    beginStr = src.substring(0, begin);
...
StringcutWordsAll(String src, String contains)
cut Words All
String result = cutWords(src, contains);
if (result.indexOf(contains) != -1) {
    return cutWordsAll(result, contains);
return result;