I believe you have a misconception on how
java works.
in your original code, you have this:
let's assume that your string is "Fred".
Since v is zero, then aChar gets set to 'F', and bChar gets set to 'r'.
Now, you enter your loop. the value of v changes, but that has NO IMPACT on aChar and bChar. Those variable have been set. Java doesn't remember that aChar was set based on the variable v, so changing v does not change those.
So each time through your loop, you keep looking at the same two characters in your if-statement.