title: extracting string with Indexof in c#
body: <p>I am trying to extract the number portion in this filename. "Name, lastname_123456_state_city.pdf" </p>
  
  <p>I have got this far..</p>
  
  <pre><code>idstring = file.Substring(file.IndexOf("_") + 1, 
      (file.LastIndexOf("_") - file.IndexOf("_") - 1));
  </code></pre>