What is the smartest way to load a string like "10101011101010" directly into a new bit array? (not a byte array)
(The bits should remain in the same order as in the list.)
You can do it with LINQ:
var res = new BitArray(str.Select(c => c == '1').ToArray());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With