How to convert a string of bits to byte array

后端 未结 7 880
悲&欢浪女
悲&欢浪女 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:31

    This should get you to your answer: How can I convert bits to bytes?

    You could just convert your string into an array like that article has, and from there use the same logic to perform the conversion.

提交回复
热议问题