Is there any java utility to convert string to hex value (integer) ?
+3
A:
Your question is a little ambiguous, I think.
If you have a hex string (e.g. "ab10"), then you can use
int i = Integer.valueOf(s, 16).intValue();
Brian Agnew
2009-07-08 12:29:56
+4
A:
When you have a string starting with 0x or #
Integer.decode(hexStr);
is the goal
Or
Integer.parseInt(hexString, 16);
Markus Lausberg
2009-07-08 12:30:58
This is what i need, thanx.. Integer i = Integer.decode("0xA"); System.out.println(i); output : 10
penguru
2009-07-08 12:48:53
+4
A:
Is this what you are looking for?
Integer.toHexString(Integer.parseInt(String));
AlbertoPL
2009-07-08 12:32:00