How to convert a string of bits to byte array

后端 未结 7 877
悲&欢浪女
悲&欢浪女 2020-12-06 08:17

I have a string representing bits, such as:

\"0000101000010000\"

I want to convert it to get an array of bytes such as:

{0x         


        
7条回答
  •  日久生厌
    2020-12-06 08:37

    Here's a quick and straightforward solution (and I think it will meet all your requirements): http://vbktech.wordpress.com/2011/07/08/c-net-converting-a-string-of-bits-to-a-byte-array/

提交回复
热议问题