I have one String variable,
str
val1
val2
val3
str
if("val1".equalsIgnoreCase(str)||"val2".equalsIgnoreCase(str)||"val3.equalsIgnoreCase(str))
{
//remaining code
}
if(("val1" OR "val2" OR "val3").equalsIgnoreCase(str) //this is only an idea.
I have found better solution this can be achieve using reg-ex -
str.matches("val1|val2|val3");
For case insensitive matching:
str.matches("(?i)val1|val2|val3");