0

I have this hexadecimal string hexavalue="03" where each digit represent 4 bit such that in the end both values will give me a bit array of 8 bit.

But i don't know how to convert that value into a bit array in c# .

fusolage
  • 11
  • 4
  • 2
    Does this answer your question? [Function convert Hex String to BitArray C#](https://stackoverflow.com/questions/4269737/function-convert-hex-string-to-bitarray-c-sharp) – Mikael May 19 '20 at 14:18
  • Try following linq : string input = "01020304050607080910"; //get nibbles iin groups of two byte[] bytes = input.Select((x, i) => new { nibble = x, index = i }).GroupBy(x => x.index / 2).Select(x => byte.Parse(x.First().nibble.ToString() + x.Last().nibble.ToString(), System.Globalization.NumberStyles.HexNumber)).ToArray(); – jdweng May 19 '20 at 15:26

0 Answers0