How to get the next character
I have a stupid question.
I have a method that gets a character. And I need to increase it by one (so if a comes in, i need make it b, if g comes in I have to make it h).
Is there a easy way to do this? i tried with inChr++ but that doesn't work...
Code:
public char increaseChar(char inChr){
return inChr= inChr++;
}
Re: How to get the next character
Re: How to get the next character
lol found the solution. posting for other newbies like me.
Code:
public char increaseChar(char inChr){
int temp = Character.getNumericValue(inChr);
temp = temp + 88;
return (char) temp;
}
Re: How to get the next character
Quote:
Originally Posted by
camickr
ops didn't see this. this works better