There is a method that returns string, a binary code is written to the string. How to convert this "text" binary code to text?

  • If the binary code is not encrypted and at the same time presents some text, then it is this text itself. so explain what you mean by "binary code" - Mike
  • That's right, it is not clear what exactly is contained in the "binary" code. There is a similar question in English SO, but there is also a guessing game. - BlackWitcher
  • Look here, it is possible to help stackoverflow.com/questions/3436398/… - Vito

1 answer 1

string bitStr = "010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"; var stringArray = Enumerable.Range(0, bitStr.Length / 8).Select(i => Convert.ToByte(bitStr.Substring(i * 8, 8), 2)).ToArray(); var str = Encoding.UTF8.GetString(stringArray);