// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Globalization; namespace E { public class Program { public static byte[] XParse(string s) { byte[] ba = new byte[s.Length / 2]; for(int i = 0; i < ba.Length; i++) { ba[i] = byte.Parse(s.Substring(2 * i, 2), NumberStyles.HexNumber); } return ba; } public static void Main(string[] args) { byte[] ba = XParse("1200B2C4D2BB9863"); foreach(byte b in ba) { Console.Write(" " + b.ToString("X2")); } Console.WriteLine(); } } }