I want to check a char variable is one of 21 specific chars, what is the shortest way I can do this?
For example:
if(symbol == (\'A\'|\'B\'|\'C\')){}
If you know all your 21 characters in advance you can write them all as one String and then check it like this:
char wanted = 'x'; String candidates = "abcdefghij..."; boolean hit = candidates.indexOf(wanted) >= 0;
I think this is the shortest way.