stringstr="1234";char[]charValues=str.ToCharArray();stringhexOutput="";foreach(char_eachCharincharValues){// Get the integral value of the character.intvalue=Convert.ToInt32(_eachChar);// Convert the decimal value to a hexadecimal value in string form.hexOutput+=String.Format("{0:X}",value);// to make output as your eg // hexOutput +=" "+ String.Format("{0:X}", value);}
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.