A binary code is entered into the program (For example: 10101001010100) you need to translate it into ASCII characters (string)
|
1 answer
Perhaps something will do.
using System; using System.Text.RegularExpressions; public class Test { public static void Main() { var a = "10101001010100"; Console.WriteLine(Regex.Replace(a, "[01]{7}", m => ((char)Convert.ToByte(m.Value, 2)).ToString())); } } But if productivity is important, you should think about another way.
|