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
Post a Comment