[RESOLVED] Convert String representation of HEX to HEX value
Hi,
I've been looking all over, but i cant seem to find an answer to this..
If i have this code for example:
String myHex = "0x1E";
Is it possible to convert that string to the actual HEX value -> 0x1E?
I don't know if i'm clear enough.
Thanks in advance.
Re: Convert String representation of HEX to HEX value
Do you mean convert from a string that has a hex value to let say an int that has that hex value so you can make calculations with it?
you can do that with parseInt from the Integer class:
Code:
String myHex = "1E";
int hexVal = Integer.parseInt(myHex, 16);
Re: Convert String representation of HEX to HEX value
Yes that's it! Thank you very much