Вопрос по java, android – Как искать во всей строке конкретное слово?

11

Error: User Rate Limit Exceeded

for (int i = 0; i < countryCode.length; i++) {
            if (textlength <= countryCode[i].length()) {
                if (etsearch
                        .getText()
                        .toString()
                        .equalsIgnoreCase(
                                (String) countryCode[i].subSequence(0,
                                        textlength))) {
                    text_sort.add(countryCode[i]);
                    image_sort.add(flag[i]);
                    condition_sort.add(condition[i]);
                }
            }
        }

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded Reyjohn
Error: User Rate Limit Exceeded mcfinnigan
Error: User Rate Limit Exceeded Teg
Error: User Rate Limit Exceededdocs.oracle.com/javase/tutorial/essential/regex/matcher.htmlError: User Rate Limit Exceeded Aamirkhan

Ваш Ответ

6   ответов
25

Error: User Rate Limit Exceeded

String string = "Test, I am Adam";
// Anywhere in string
b = string.indexOf("I am") > 0;         // true if contains 

// Anywhere in string
b = string.matches("(?i).*i am.*");     // true if contains but ignore case

// Anywhere in string
b = string.contains("AA")  ;             // true if contains but ignore case
Error: User Rate Limit Exceeded Reyjohn
Error: User Rate Limit Exceeded
3

Error: User Rate Limit Exceededcontains(CharSequence)Error: User Rate Limit Exceeded

0

Error: User Rate Limit Exceeded

etsearch.getText().toString().contains((String) countryCode[i]);
0

Error: User Rate Limit Exceeded

myString.contains("xxx");

Error: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit Exceeded

0

Error: User Rate Limit Exceeded

public boolean contains (CharSequence cs)

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Parameters

csError: User Rate Limit Exceeded

Returns

trueError: User Rate Limit Exceededfalse

7

Error: User Rate Limit Exceeded

    b = string.indexOf("I am") >= 0; 
Error: User Rate Limit Exceeded

Похожие вопросы