0

Possible Duplicate:
Convert a binary string representation to a byte array

I have a string s = "010101010001..." of ones and zeros that I would like to write to a binary file. How is this done?

Community
  • 1
  • 1
sdasdadas
  • 23,917
  • 20
  • 63
  • 148
  • Thank you, that is the answer I was looking for. I did look through quite a few topics on this site - however, I mostly found going from Binary to String. – sdasdadas Jan 04 '12 at 23:35

1 Answers1

3

Split the string every 8 characters and then convert it to a Byte with Convert.ToByte.