I need to convert char to hex values. Refer to the Ascii table but I have a few examples listed below:
- char 1 = 31 2 = 32 3 = 33 4 = 34 5 = 35 A = 41 a = 61 etc
Therefore string str = "12345"; Need to get the converted str = "3132333435"
I need to convert char to hex values. Refer to the Ascii table but I have a few examples listed below:
Therefore string str = "12345"; Need to get the converted str = "3132333435"
I think this is all you'll need:
More info on MSDN: http://msdn.microsoft.com/en-us/library/system.text.encoding.ascii.aspx
Edit: To Hex:
To get it in a single line, and more readable (imo)
this returns
"3132333435"
, just as you requested :)