I will be reading in a String of two character in Java. And I want to determine what will be the next increment of it. Below is the rules of increment.
AA -> AB -> AC -> ... -> AZ -> BA -> BB -> ... -> ZZ -> AA
So if I read in AC
, I will print out AD
.
EDIT
I can do increment of one character, like this System.out.println((char) ('C' + 1));
. So I was thinking about parsing the string, get the individual character, just increment or decrement the value of char. The wrap around is what get me, like AZ
-> BA
. Not sure what the best way to achieve that yet. What are your thought