String contains Ignore Case - Android java.lang

Android examples for java.lang:String Contains

Description

String contains Ignore Case

Demo Code

import java.util.List;
import java.util.Map;

public class Main{

    public static boolean containsIgnoreCase(String str, String cs) {
        return str != null && cs != null && str.length() >= cs.length()
                && str.toLowerCase().contains(cs.toLowerCase());
    }//from   w w  w . j ava 2 s .c  o  m

}

Related Tutorials