is String array Containing a value - Android java.lang

Android examples for java.lang:String Contains

Description

is String array Containing a value

Demo Code

import android.text.TextUtils;

public class Main{


    public static boolean isContains(String[] strs, String values) {
        if (values != null && strs != null && strs.length > 0) {
            for (String str : strs) {
                if (str.equals(values)) {
                    return true;
                }/*  w  w w  . j a v a2s .c o m*/
            }
        }
        return false;
    }

}

Related Tutorials