
-----------------------------------
Martin
Thu Jul 21, 2005 8:16 pm

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'

-----------------------------------
Martin
Thu Jul 21, 2005 8:22 pm


-----------------------------------
Figured it out. Java is gross.

Conversion from an int to a String.

int x = 97;
System.out.println (((char) x) + "");

-----------------------------------
rizzix
Thu Jul 21, 2005 8:28 pm


-----------------------------------
eh? why not simply... char a = 97;
System.out.println(a);

oh, but if you want a String yea just concatenate it with +""
or...String a = new String(new char

or best... String a = Character.toString(97);
