How to read first 4 and last 4 bits from byte?
bit, byte, c#
Solution
Use bitwise `AND` and shifts, like this:
byte b = 0xAB;
var low = b & 0x0F;
var high = b >> 4;
Problem
C# how to read first 4 and last 4 bits from byte ?
bit, byte, c#
Use bitwise `AND` and shifts, like this:
byte b = 0xAB;
var low = b & 0x0F;
var high = b >> 4;
C# how to read first 4 and last 4 bits from byte ?