Computer Science Canada Java String from ASCII value |
Author: | Martin [ Thu Jul 21, 2005 8:16 pm ] |
Post subject: | Java String from ASCII value |
How do I create a string containing the character represented by an int ASCII value? I've tried casting from int to char, but apparently that doesn't work. ie. x = 97; System.out.println (ASCIIString(x)); //print 'a' |
Author: | Martin [ Thu Jul 21, 2005 8:22 pm ] |
Post subject: | |
Figured it out. Java is gross. Conversion from an int to a String. int x = 97; System.out.println (((char) x) + ""); |
Author: | rizzix [ Thu Jul 21, 2005 8:28 pm ] | ||||||
Post subject: | |||||||
eh? why not simply...
oh, but if you want a String yea just concatenate it with +"" or...
or best...
|