title: Substring and IndexOf and LastIndexOf in c#
body: <p>I have this <strong>string</strong> :</p>
  
  <blockquote>
    <p>464-138234-AVENANCE</p>
  </blockquote>
  
  <p>And I need this output on three items :</p>
  
  <pre><code> 464
   138234
   AVENANCE
  </code></pre>
  
  <p>For first item I have try with success :</p>
  
  <pre><code>strMyString.SelectedItem.Value.Substring(0, strMyString.SelectedItem.Value.IndexOf('-'))
  </code></pre>
  
  <p>Output : <code>464</code></p>
  
  <p>I can't to extract the two and three items :</p>
  
  <pre><code>strMyString.SelectedItem.Value.Substring(1, strMyString.SelectedItem.Value.IndexOf('-'))
  </code></pre>
  
  <p>The output is :</p>
  
  <pre><code>64-
  </code></pre>
  
  <p>Can you help me?</p>
  
  <p>Thank you in advance for any help, really appreciated.</p>