title: Get indexes of all matching values from list using Linq
body: <p>Hey Linq experts out there,</p>
  
  <p>I just asked a very similar question and know the solution is probably SUPER easy, but still find myself not being able to wrap my head around how to do this fairly simple task in the most efficient manner using linq.</p>
  
  <p>My basic scenario is that I have a list of values, for example, say:</p>
  
  <pre><code>Lst1:
  a
  a
  b
  b
  c
  b
  a
  c
  a
  </code></pre>
  
  <p>And I want to create a new list that will hold all the indexes from Lst1 where, say, the value = "a".
  So, in this example, we would have:</p>
  
  <pre><code>LstIndexes:
  0
  1
  6
  8
  </code></pre>
  
  <p>Now, I know I can do this with Loops (which I would rather avoid in favor of Linq) and I even figured out how to do this with Linq in the following way:</p>
  
  <pre><code>LstIndexes= Lst1.Select(Function(item As String, index As Integer) index) _
                  .Where(Function(index As Integer) Lst1(index) = "a").ToList
  </code></pre>
  
  <p>My challenge with this is that it iterates over the list twice and is therefore inefficient.</p>
  
  <p>How can I get my result in the most efficient way using Linq?</p>
  
  <p>Thanks!!!!</p>