Reputation: 5628
I have a String containing ASCII representation of a character i.e.
String test = "0x07";
Is there a way I can somehow parse it to its character value.
I want something like
char c = 0x07;
But what the character exactly is, will be known only by reading the value in the string.
Upvotes: 0
Views: 574
Reputation: 520
You have to add one step:
String test = "0x07";
int decimal = Integer.decode(test);
char c = (char) decimal;
Upvotes: 2