title: Using index in SelectMany LINQ
body: <p>I am trying to do numbered groups of a list.
  For example this LINQ query gives what I want           </p>
  
  <pre><code>(from word in "The quick brown fox jumps over the lazy dog" .Split()
  group word by word.Length into w
  select w)
  .Select((value, index) =&gt; new { i = index + 1, value })
  .SelectMany(
  sm =&gt; sm.value,
  (sm, s) =&gt; new { sm.i, s})
  
  1 The 
  1 fox 
  1 the 
  1 dog 
  2 quick 
  2 brown 
  2 jumps 
  3 over 
  3 lazy 
  </code></pre>
  
  <p>But I decided to optimize this query: Why we need use external to SelectMany index if it has own index in 4th overload of SelectMany?
  And I tried to use this overload in next way, but I do not see the solution.</p>
  
  <pre><code>(from word in "The quick brown fox jumps over the lazy dog".Split()
             group word by word.Length into w
             select w)
                  .SelectMany(
                  (source, index) =&gt; ??????,
                  (msource, coll) =&gt; ??????) 
  </code></pre>