title: VB.net XOR operation using HEX
body: <p>I want to calculate a BCC XOR in hex using Visual Basic 2012 for the following String: H enter * in hex (48 0D 2A) using the following rule: <br>
  <code>Step 1. BCCXOR = 00h</code> BCCXOR = 00<br>
  <code>Step 2. BCCXOR = BCCXOR xor 48</code> BCCXOR xor first character - result BCCXOR = 48h<br>
  <code>Step 3. BCCXOR = BCCXOR xor 0D</code> BCCXOR xor second character - result BCCXOR = 44h<br>
  <code>Step 4. BCCXOR = BCCXOR xor 2A</code> BCCXOR xor third character - result BCCXOR = 6Fh<br></p>
  
  <p>My code is:</p>
  
  <pre><code>    Dim BCCXOR As Integer = &amp;H0
      For i As Integer = 0 To TextBox1.TextLength - 1
          BCCXOR = (BCCXOR) Xor Conversion.Hex(Strings.Asc(TextBox1.Text.Substring(i, i + 1).ToString()))
      Next
      BCCXOR = BCCXOR Xor Hex(&amp;HD)
      BCCXOR = BCCXOR Xor Hex(&amp;H2A)
      TextBox2.Text = BCCXOR
  </code></pre>
  
  <p>My problem is that I receive an error message when I'm trying to calculate BCCXOR xor 0D I receive an error like: <br>
  Conversion from string "D" to type 'Long' is not valid.</p>