Is it possible to do something like this in Java for Android (this is a pseudo code)
IF (some_string.equals("john" OR "mary" OR "peter" OR "etc."){
THEN do something
}
?
At the moment this is done via multiple String.equals() condition with || among them.
Possibilities:
Use
String.equals():Use a regular expression:
Store a list of strings to be matched against in a Collection and search the collection: