title: How do I convert a string to an integer when the string starts with non-numeric characters and leading zeroes?
body: <p>I have some strings which are dynamically created at run time.</p>
  
  <p>The values are generated in sequence with an underscore, leading zeroes and then the sequence number. The format looks like so:</p>
  
  <pre><code>_00001  
  _00002  
  _00003  
  _00004
  
  _00098  
  _00099  
  _00100  
  _00101
  </code></pre>
  
  <p>I would like to extract the number part as Integer, ignoring the underscore and leading zeroes.</p>
  
  <p><code>StringReplace</code> can easily remove the underscore part, but how can I extract the number part as I have no way of knowing what the values are?</p>
  
  <p>Some example outputs of how such a function would work:</p>
  
  <p><code>_00003</code> = <code>3</code><br>
  <code>_00098</code> = <code>98</code><br>
  <code>_00482</code> = <code>482</code><br>
  <code>_07218</code> = <code>7218</code><br>
  <code>_14005</code> = <code>14005</code><br>
  <code>_37585</code> = <code>37585</code><br>
  <code>_69732</code> = <code>69732</code></p>
  
  <p><code>StringReplace</code> and <code>Pos</code> is what I am thinking, but I am not always sure as to how to fully use <code>Pos</code>, and the <code>StringReplace</code> method could possibly be messy.</p>
  
  <p>I think all I need to do is check for the first number that is not 0, but maybe I am confusing myself again so really any pointers are welcome.</p>