Assuming the byte is represented by the last two digits, and the line size is fixed at 4 characters, then the answer could be:
return (int)hexValue[2] & 1 == 1;
As you can see, you do not need to convert the entire string to binary in order to evaluate the 5th bit, it is really the LSB of the third character.
, , - :
return (int)hexValue[hexValue.Length-2] & 1 == 1;
2, :
return hexValue.Length < 2 ? 0 : (int)hexValue[hexValue.Length-2] & 1 == 1;
, 1 5.
user694833