-
October 25th, 2011, 09:59 AM
#1
[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.
-
October 26th, 2011, 06:04 PM
#2
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);
-
October 26th, 2011, 06:28 PM
#3
Re: Convert String representation of HEX to HEX value
Yes that's it! Thank you very much
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|