Searching a list to get index values in c#
<p>I have a string comma separated list of some data. I have another list of strings of keywords that i want to search for in the first list. I want to have returned to me the index of all the elements in the first list that do no contain any of the keywords in the second list. For example:</p>

<pre><code>List 1:
Student,101256,Active
Professor,597856,Active
Professor,697843,Inactive
Student,329741,Active
Student,135679,Inactive
Student,241786,Inactive

List 2:
697843
241786
</code></pre>

<p>My query on List 1 should be, give me all the index of all the elements that do not contain any of the elements of list 2. Therefore, the return list of indices should be 0,1,3,4. Is there any way to accomplish this?</p>

<p>Thanks in advance!</p>

<p>Edit: This is my try:</p>

<pre><code>List&lt;int&gt; index = list1
        .Select((s, i) =&gt; new { s, i })
        .Where(e =&gt; !list2.Contains(e.s))
        .Select(e =&gt; e.i).ToList();
</code></pre>
