title: How to get a text value from a sub string by index in C#
body: <p>I have a <code>listview1</code> with information about students that can change repeatedly, as well for the Student Names (<code>Column1</code>) and the Students task <code>Column2</code>.</p>
  
  <p>I have a <code>textBox1</code> where you can type the name a possible student in <code>Column1</code>.
  That name will be transfered into a <code>string</code> named <code>searchstr</code>.</p>
  
  <p>As soon as the command hits, an item in <code>Column1</code> will be checked for it's existence (and if it equals the <code>searchstr</code>). </p>
  
  <p>if so, the Name of that student has an Index number which I receive via the commandline <code>var index = listview.Items.IndexOf(Name);</code></p>
  
  <p>Now with that Index number I try to receive the text value of that students task (the Subitem from <code>Column2</code>) and set it in a string. Is this possible?</p>
  
  <pre><code>foreach (ListViewItem item in listview1.Items)
   {
     if (item.SubItems[0].Text == searchstr)
       {
         var Name = listview1.FindItemWithText(searchstr);
  
         if (Name != null)
          {
            var index = listview.Items.IndexOf(Name);
          }
       }
  
   }
  </code></pre>