I would like to know if there is any method in Java where I can have an ASCII value (int) as input and get the corresponding char value as output. I would also like to know how it can be done the other way, char as input and its ASCII value (int) as output.
Joined: Sep 15, 2004
To convert an ASCII(int) to its corresponding char:
where i is an int with a value between 33 & 126 (resulting in an upper- or lowercase letter or a number)
The other way 'round:
where a is a char, being upper- or lowercase or a number.
Hoping to have been of any assistance. Eric
Joined: Jul 25, 2004
Thanks! It worked.
Joined: Dec 10, 2001
Note that casting a char to an int is unnecessary. You could simply assign the char value to the int.