| Author |
convert String Value to Hexa Value ?
|
sachin kataria
Ranch Hand
Joined: Mar 27, 2006
Posts: 43
|
|
hi, i want to convert String value to Hexa Value. so, how i can do that ?? my String value len is 20. i.e. String str = "31080601090620003453"; so, how i convert this value to hexa value.. pls, help me....
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24061
|
|
|
I can't tell precisely what you're after, but I suspect that the parseInt() and toHexString() methods in the java.lang.Integer class will do exactly what you need.
|
[Jess in Action][AskingGoodQuestions]
|
 |
Carl Trusiak
Sheriff
Joined: Jun 13, 2000
Posts: 3340
|
|
20 places will exceed Long.MAX_VALUE of 9223372036854775807 19 places so, Use BigInteger The second toString takes the radix of the number base. For hex it's 16. [ August 31, 2006: Message edited by: Carl Trusiak ]
|
I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
|
 |
 |
|
|
subject: convert String Value to Hexa Value ?
|
|
|