Categories
How to translate the string "01001110" into 1 byte?
Is it only to manually write the translation algorithm? Or is it simple?
Answer the question
In order to leave comments, you need to log in
String s = "01001110"; byte b = Byte.parseByte(s, 2);
using System; using System.Text; class Program { static void Main(string[] args) { byte[] str = new byte[] { 0x7B, 0x22, 0x62, 0x61, 0x6C, 0x61, 0x6E, 0x63, 0x65, 0x22, 0x3A, 0x30, 0x2C, 0x22 , 0x62, 0x6F}; Console.WriteLine(Encoding.ASCII.GetString(str)); } }
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question