In Java, how can I test if an Array contains a certain value?
Posted
by Mike Sickler
on Stack Overflow
See other posts from Stack Overflow
or by Mike Sickler
Published on 2009-07-15T00:03:21Z
Indexed on
2010/06/11
2:42 UTC
Read the original article
Hit count: 192
java
I have a String[]
with values like so:
public static final String[] VALUES = new String[] {"AB","BC","CD","AE"};
Given String s, is there a good way of testing whether VALUES
contains s
?
© Stack Overflow or respective owner