How to convert a string into hex code and vice versa
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   suresh_kumar
Posted On:   Monday, November 22, 2004 10:52 PM


How can we convert a String into Hex code and again convert Hex code to original string ?
is it possible through java ?
is there any classes for that?
if anyone knows post the reply..

Re: How to convert a string into hex code and vice versa

Posted By:   Jyri_Saastamoinen  
Posted On:   Tuesday, November 23, 2004 03:56 AM

To hex string:



public String ToHex(String s)
{
String hex="";
for(int i = 0; i{
int ch = (int)s.charAt(i);
hex = "00"+Integer.toHexString( ch );

}

return hex;
About | Sitemap | Contact