0

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.

2

1 Answer 1

2

You have to add one step:

String test = "0x07";
int decimal = Integer.decode(test);
char c = (char) decimal;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.