Link to home
Start Free TrialLog in
Avatar of CSecurity
CSecurityFlag for Iran, Islamic Republic of

asked on

Java Hex to String

Hello

I want to convert a Hex String to String.
Example input:

41424344

Example output:
ABCD

Thanks from now!
Avatar of ksivananth
ksivananth
Flag of United States of America image

I don't think you can do that! there should be some delemeter between each char representation...
Avatar of CSecurity

ASKER

Hex maximum length is 2
and for hex with length 1 there will be zero before it
ASKER CERTIFIED SOLUTION
Avatar of Bart Cremers
Bart Cremers
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CEHJ

String s = new String(new BigInteger("41424344").toByteArray()));

Open in new window

String s = new String(new BigInteger("41424344", 16).toByteArray()));