Results 1 to 4 of 4
Thread: How to get the next character
- 10-24-2011, 05:34 PM #1
Member
- Join Date
- Oct 2011
- Posts
- 3
- Rep Power
- 0
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...
Java Code:public char increaseChar(char inChr){ return inChr= inChr++; }
- 10-24-2011, 06:02 PM #2
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,143
- Rep Power
- 5
Re: How to get the next character
Java Code:return ++inChr;
- 10-24-2011, 06:19 PM #3
Member
- Join Date
- Oct 2011
- Posts
- 3
- Rep Power
- 0
Re: How to get the next character
lol found the solution. posting for other newbies like me.
Java Code:public char increaseChar(char inChr){ int temp = Character.getNumericValue(inChr); temp = temp + 88; return (char) temp; }
- 10-24-2011, 06:22 PM #4
Member
- Join Date
- Oct 2011
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
^ Escape character
By GaBuG in forum Advanced JavaReplies: 3Last Post: 12-31-2010, 01:04 AM -
Character Count
By drucey in forum New To JavaReplies: 8Last Post: 11-22-2010, 08:02 PM -
getting each character from keyboard
By Sreejesh25 in forum Advanced JavaReplies: 6Last Post: 03-05-2010, 07:12 PM -
Read from a certain character to a certain character
By blackstormattack in forum New To JavaReplies: 0Last Post: 03-16-2009, 11:36 AM -
reading text character by character
By bugger in forum New To JavaReplies: 2Last Post: 11-09-2007, 08:54 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks