// 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; using System.Text.RegularExpressions; namespace E { class MainClass { public static string U2U(string s) { string res = s; MatchCollection reg = Regex.Matches(res, @"\\u([0-9A-F]{4})"); for(int i = 0; i < reg.Count; i++) { res = res.Replace(reg[i].Groups[0].Value, "" + (char)int.Parse(reg[i].Groups[1].Value, NumberStyles.HexNumber)); } return res; } public static void Main(string[] args) { Console.WriteLine(U2U(@"\u0041\u0042\u0043\u000A\u0031\u0032\u0033")); } } }