I\'m working on serial port, transmitting and receiving data to some hardware at 8bit data. I would like to store it as string to facilitate comparison, and preset data are
I think you should use a byte array instead. For comparison you can use some method like this:
static bool CompareRange(byte[] a, byte[] b, int index, int count)
{
bool res = true;
for(int i = index; i < index + count; i++)
{
res &= a[i] == b[i];
}
return res;
}