mardi 21 mai 2019

How do you check if search box text matches the link?

I have a searchbox: ex: When you type a text: BestBuy and click search and couple links shows up as BestBuy link. How do you verify text matches with first link. It's similiar to google search engine.

public boolean check(String enterNameOfLink, String matchText) {
    return check.Matches(matchText, enterNameOfLink);

    Matches(String textToCheck, MobileElment link) {
        boolean check = false;
        for(int i = 0; i < link.lenght; i++){
            match = element[i].getText().trim().equalsIgnoreCase(textToCheck);
            if(check){
                return match;
            }
        }
    }
    return false;
}

I get an error it does not match.

Aucun commentaire:

Enregistrer un commentaire