title: Get lower nibble of a byte and replace Hex value
body: <p>I need to replace the hex value 0xA with a 0 and get only the lower nibble of a hex value.   </p>
  
  <p><img src="https://i.stack.imgur.com/I2yKh.png" alt="enter image description here"></p>
  
  <p>This is what  I have at the moment:</p>
  
  <pre><code>    private void ParseContactID(int ContactID_100, int ContactID_10, int ContactID_1)
      {
          // (A=0)
  
          string Hunderds = ContactID_100.ToString("X").Replace((char)0xA, '0');
          string Dozens = ContactID_10.ToString("X").Replace((char)0xA, '0');
          string Singles = ContactID_1.ToString("X").Replace((char)0xA, '0');
  
  
          int HunderdsLower = StringToHex(Hunderds) &amp; 0x0F;
          int DozensLower = StringToHex(Dozens) &amp; 0x0F;
          int SinglesLower = StringToHex(Singles) &amp; 0x0F;
      }
  </code></pre>
  
  <p>Should I &amp; with 0x0F to get the lower nibble or 0xF0?<br>
  And is there a way to replace 0xA without converting it to a string first?</p>