| Author |
Ascii to hex converter
|
Ghaith Shamayleh
Greenhorn
Joined: Apr 13, 2011
Posts: 13
|
|
|
I would like if there is a function in java that can be used to covert a string of ascii to a string of hex, or should i write a method to write this, can anyway help
|
 |
Ralph Cook
Ranch Hand
Joined: May 29, 2005
Posts: 479
|
|
This one does it one character at a time; I'm actually cramming unicode into byte, but if you have ASCII (in 7 or 8 bits), it will cast to byte as well.
Look up details for formatting string output under java.util.Formatter
rc>
|
 |
Ghaith Shamayleh
Greenhorn
Joined: Apr 13, 2011
Posts: 13
|
|
|
this will take a string of hex and convert it or a string of ascii and covert it
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32833
|
|
|
What is a String of hex? Do you mean a String which only contains the characters 0-9 a-f and A-F? Your last comment appears to want the opposite of what the thread title says you want.
|
 |
Ghaith Shamayleh
Greenhorn
Joined: Apr 13, 2011
Posts: 13
|
|
|
i got it cheers everyone
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32833
|
|
Well done
|
 |
 |
|
|
subject: Ascii to hex converter
|
|
|