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

Android examples for java.lang:array

Description

is a string contains In string Array

Demo Code

public class Main{

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

}

Related Tutorials