Users Pricing

forum

Home Forums In Java, how can I test if an Array contains a certain value? – MindStick

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

Anonymous User 2033 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?

2 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md