is a string contained In a string Array - Android java.lang

Android examples for java.lang:array

Description

is a string contained In a string Array

Demo Code

import android.text.TextUtils;
import java.util.ArrayList;
import java.util.Locale;

public class Main{

    public static boolean containsInArray(String key, String[] array) {
        for (final String element : array) {
            if (key.equals(element))
                return true;
        }//from  w w  w .  j av  a  2  s.c  om
        return false;
    }

}

Related Tutorials