Created by Winni Neessen 2016-06-13 View revision File snippet.cs Added Side-by-side diff More Ignore whitespace Hide word diff +string str = "1234"; +char[] charValues = str.ToCharArray(); +string hexOutput=""; +foreach (char _eachChar in charValues ) +{ + // Get the integral value of the character. + int value = 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); + +}