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
?
转载于:https://stackoverflow.com/questions/1128723/how-to-determine-whether-an-array-contains-a-particular-value-in-java