title: c# string.remove & Regex.Match
body: <p>I have a text file that I'm searching through and I want to skip the 10 first characters in every line.</p>
  
  <p>Each line starts with <code>[10:16:01]</code>, thats what I want to skip and I want to find the next number in the line and add the numbers together.</p>
  
  <p>This is what I've managed to do so far     </p>
  
  <pre><code>foreach (string line in lines)
  {
      string a = line.Remove(0, 10);
      if (a.Contains("whateverimsearchingfor"))
      {
  
              string resultString = Regex.Match(a, @"\d+").Value;
              int result = Int32.Parse(resultString);
  
          total += result
   }
  </code></pre>
  
  <p>Thanks in advance!</p>
  
  <p>Sorry when I try and build I get:</p>
  
  <blockquote>
    <p>ArgumentOutOfRangeException was unhandled
    index and count must refer to a location within the string</p>
  </blockquote>
  
  <p>It points to the string a = line.remove(0, 10)</p>
  
  <p>Hope this is enough.</p>