forum

home / developersection / forums / in java, how can i test if an array contains a certain value?

In Java, how can I test if an Array contains a certain value?

Anonymous User 1923 08-May-2015
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?

Updated on 09-May-2015

I am a content writter !


Message
Can you answer this question?

Answer

2 Answers

Liked By