Check string contains using String.contains method and handle null value - Android java.lang

Android examples for java.lang:String Contains

Description

Check string contains using String.contains method and handle null value

Demo Code

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

public class Main{

    public static boolean contains(String str, CharSequence cs) {
        return str != null && cs != null && str.contains(cs);
    }//from   ww w  . j  a v  a 2  s .  com

}

Related Tutorials