Check in a list of string contains another string Ignore Case - Android java.lang

Android examples for java.lang:String Case

Description

Check in a list of string contains another string Ignore Case

Demo Code

import android.text.Html;
import android.text.TextUtils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;

public class Main{

    public static boolean containsIgnoreCase(List<String> l, String s) {
        Iterator<String> it = l.iterator();
        while (it.hasNext()) {
            if (it.next().equalsIgnoreCase(s)) {
                return true;
            }/*w ww. j  a  v a  2s  . c o m*/
        }
        return false;
    }

}

Related Tutorials