java - find item in list of static final Strings -


i have list of static strings:

static final string foo = "foo"; static final string bar = "bar"; static final string duh = "duh"; static final string goo = "goo"; static final string zut = "zut"; 

i want check if given string part of list, want keep possibility reference each item individually. want check implementation unaware of individual items. not this:

boolean isvalid(string item) {   return (item.equalsignorecase(foo) || item.equalsignorecase(bar) || ......) } 

thnx! bas hendriks

create array containing strings , use loop check if 1 of them matches input string.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -