This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Convert a Numeric Value into associated Character Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Convert a Numeric Value into associated Character" Watch "Convert a Numeric Value into associated Character" New topic
Author

Convert a Numeric Value into associated Character

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1391
I need to take an encripted string of numbers and change it into readible string. This is my code which will return the correct values for each character but I don't know how to get the character associated with each value. Example 48 = 0, 54 = 5, 106 = j

marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by Steve Dyke:
...I don't know how to get the character associated with each value. Example 48 = 0, 54 = 5, 106 = j...

All you need to do is cast the numeric value to type char.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1391
Thanks. That works great.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Convert a Numeric Value into associated Character
 
Similar Threads
equals() method
hashcode and equals()
Test User Input Sting to Object
hashcode question
Incompatible types