title: Force an integer to be two digits - VB
body: <p>I have a variable that holds a string <code>"02100030000000000000000000D5010008D501000804"</code> and I'm byte separating the string using </p>
  
  <pre><code>For i As Integer = 1 To (stringReader.Length - 1) Step 2
                  'Get the successive 2-character substrings, parse as bytes and add to total
                  Dim b As Byte = Byte.Parse(stringReader.Substring(i, 2), NumberStyles.AllowHexSpecifier)
                  sum = sum + CInt(b)
  
              Next    
  </code></pre>
  
  <p>I'm converting the strings to direct integers.e.g:(string"10" to Integer10 and ).  That works fine.  But Whenever I convert the string"02" to Integer, I get only Integer(2) and I need Integer(02).  How can I proceed with?  </p>
  
  <p>My code is:      </p>
  
  <pre><code>stringReader = fileReader.ReadLine()      
  byt = stringReader(1) + stringReader(2)      
  </code></pre>
  
  <p>stringreader contains something like <code>"100030000000000000000000D5010008D501000804"</code></p>
  
  <p>Byte separation  </p>
  
  <pre><code>For i As Integer = 1 To (stringReader.Length - 1) Step 2
                  'Get the successive 2-character substrings, parse as bytes and add to total
                  Dim b As Byte = Byte.Parse(stringReader.Substring(i, 2), NumberStyles.AllowHexSpecifier)
                  sum = sum + CInt(b)
  
              Next  
  </code></pre>