aspose file tools*
The moose likes Beginning Java and the fly likes can you increment letters? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "can you increment letters?" Watch "can you increment letters?" New topic
Author

can you increment letters?

Fred Abbot
Ranch Hand

Joined: Jun 01, 2000
Posts: 300
hi
I have a String which is the letter A is there anyway i can dynamically chane it to B ?
obviously A + 1 = A1
but is there something similar for letters?
thank you
Terence Doyle
Ranch Hand

Joined: May 30, 2001
Posts: 328
HI
If it's just letters you want why not use char??
The code below prints out j and then k.

Hope that helps,
Terry Doyle


Raising Flares debut album 'Ignition' out now

http://www.raisingflares.com

Terry Doyle <br />SCPJ 1.4 , SCWCD , SCMAD(Beta)
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Remember, Strings are immutable, so there is nothing that you can do to dynamically or explicitly change the value of a string.
The suggestion to use chars is a good one. Remember that chars are primitive in Java.

------------------
Brian Hoff
Sun Certified Programmer for the Java� 2 Platform
 
wood burning stoves
 
subject: can you increment letters?