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\')){}
pseudocode as I haven't got a java sdk on me:
Char candidates = new Char[] { 'A', 'B', ... 'G' }; foreach(Char c in candidates) { if (symbol == c) { return true; } } return false;