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.
Eric Zanders
Greenhorn
Joined: Sep 15, 2004
Posts: 16
posted
0
Anders,
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
Anders Engstr�m
Greenhorn
Joined: Jul 25, 2004
Posts: 4
posted
0
Thanks! It worked.
Dirk Schreckmann
Sheriff
Joined: Dec 10, 2001
Posts: 7023
posted
0
Note that casting a char to an int is unnecessary. You could simply assign the char value to the int.