Getting index of duplicate items in a list in c#
<p>I am looking for a way to get the index of all elements in a list from a keyword search within the list. So for example my list has:</p>

<pre><code>Hello World
Programming Rocks
Hello
Hello World
I love C#
Hello
</code></pre>

<p>Now from this list of strings, i want to get all the indices of elements that say Hello World. I have tried the following but it only returns the first index it finds that has my search criteria:</p>

<pre><code>    for (int i = 0; i&lt; searchInList.Count; i++)
        foundHelloWorld[i] = searchInList.IndexOf("Hello World");
</code></pre>

<p>Anyone know of a way to do this?</p>

<p>Thanks</p>
