title: How to select array index after Where clause using Linq?
body: <p>Suppose I have the array <code>string[] weekDays = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" };</code> , and I want to find out the index of array elements containing 's'. How can I do this using Linq ?</p>
  
  <p>I've tried <code>int[] indexOfDaysContainingS = weekDays.Where(day =&gt; day.Contains("s")).Select((day, index) =&gt; index).ToArray();</code>, but this returns <code>0,1,2</code> as presumably it's getting the index of the filtered <code>IEnumberable&lt;string&gt;</code> after the Where() clause instead. If I put the Select() first, then all I have is the index and can't filter by the days. </p>
  
  <p>What do I need to change to make it work and return <code>1,2,3</code> instead ?</p>