if ({nthcharacter of $string} eq "x")