-
August 11th, 2010, 03:27 PM
#1
String to hex conversion
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
-
August 11th, 2010, 06:14 PM
#2
Re: String to hex conversion
One way is to use the Integer.toHexString() method.
Extract a char from the String and use the method
Norm
-
August 11th, 2010, 06:26 PM
#3
Re: String to hex conversion
Last edited by dlorde; August 11th, 2010 at 06:29 PM.
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
-
August 12th, 2010, 01:32 PM
#4
Re: String to hex conversion
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
-
August 12th, 2010, 01:41 PM
#5
Re: String to hex conversion
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.
__________________
Norm
-
August 12th, 2010, 06:16 PM
#6
Re: String to hex conversion
Originally Posted by imdondon
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
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
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|