list of string Contains Ignore Case - Android java.lang

Android examples for java.lang:String Contains

Description

list of string Contains Ignore Case

Demo Code

import java.util.ArrayList;
import java.util.Iterator;

public class Main{

    public static boolean listContainsIgnoreCase(List<String> list,
            String str) {/*from   ww w. j  a v a  2 s.c  o m*/
        for (Iterator<String> iterator = list.iterator(); iterator
                .hasNext();) {
            String string = (String) iterator.next();

            if (string.equalsIgnoreCase(str))
                return true;
        }
        return false;
    }

}

Related Tutorials