A couple of caveats: shorter code != quicker execution as your question presupposes. Secondly there is quicker and quicker: the hearts of people at the base of a mountain beat more quickly than those at the top (and their lives are correspondingly shortened). It's a general relativistic effect and it is simply *not* worth worrying about (unless your clocks are launched into space as part of a military grade GPS system in which case the clock speed in a gravitational field matters). The time savings you are chasing are, similarly, more theoretical than real.
There is a String method that will test whether a character is present in a String and that could be used here. The resulting code would be more
readable and that matters more than speed.