Hi,
I am a new programmer of java ,I want to convert a string into hex .Suppose if I have a value "A" then the program must convert it into "41",if I have "B" then it must be converted into "42".
Kindly write the complete program
Thanks
Printable View
Hi,
I am a new programmer of java ,I want to convert a string into hex .Suppose if I have a value "A" then the program must convert it into "41",if I have "B" then it must be converted into "42".
Kindly write the complete program
Thanks
One way is to use the Integer.toHexString() method.
Extract a char from the String and use the method
:rolleyes: No.
Thanks.
You do it :wave: Looks like you want the ASCII character value as a hex string.
Use the Integer.valueOf method to convert the character value of the String to it's decimal ASCII value. Then use the Integer.toString method with a radix argument to convert that decimal value to a string representation of its hex value (that's the long way round :D).
All truths are easy to understand once they are discovered; the point is to discover them...
G. Galilie
Would anybody please write the program of conversion "ABCD" into hex.
Actully I have tried alot but there come errors.So I will be highly thankfull if some body write a working program
Thanks
Did you try this:
Extract a char from the String (see String methods) and use the Integer.toHexString() method
A char will convert to an int for the method call above.
Loop over the length of the String.
__________________
You usually have to pay to have someone write code for you on demand. There are other sites for buying code. This forum is about helping you to write the code yourself.
If you want help with errors, explain what is going wrong and post the code and the full text of the error messages.
The value of a prototype is in the education it gives you, not in the code itself...
A. Cooper