0

How do I convert a String written as Binary, to binary (in byte array)?

EDIT: I want to write on textBox a binary data as (0101111100010101..), and when I want to take it I use textBox.text (this way give me binary string "0101111100010101...") therefore when I convert it to byte array it give me: (48 it means "0") and (49 it means "1") which is ASCII, now I want to convert each 8 bits from binary string: "0101111100010101" to byte (create a byte array)

  • No, it's really not clear to me at the moment - what do you expect the output to be? A 4-byte array where each byte has a value of 0, or just a 1-byte array with a value of 0, because a byte has 8 bits? – Jon Skeet Nov 09 '21 at 12:12
  • This will help u: https://stackoverflow.com/questions/3436398/convert-a-binary-string-representation-to-a-byte-array – D A Nov 09 '21 at 12:12
  • thank you,I edit my question – Mazen Nawlo Nov 09 '21 at 13:01

0 Answers0