title: LINQ - Find item index in listbox
body: <p>I using this code to get item index in listbox:</p>
  
  <pre><code>string searchfor = "B";
  for (int i = 0; i &lt; listBox1.Items.Count; i++)
  {
      listBox1.SelectedIndex = i;
      if (searchfor == listBox1.Text)
          Console.WriteLine(listBox1.SelectedIndex);
  }
  </code></pre>
  
  <p>List items:</p>
  
  <pre><code>A
  B  =&gt; 1
  F
  E
  R
  B  =&gt; 5
  Y
  B  =&gt; 7
  G
  B  =&gt; 8
  </code></pre>
  
  <p>Can anyone help me to do it with linq?</p>