title: How to split into sublists using LINQ?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/419019/split-list-into-sublists-with-linq">Split List into Sublists with LINQ</a>  </p>
  </blockquote>
  
  
  
  <p>I'm looking for some way to split an enumerable into three enumerables using LINQ, such that each successive item in the input is in the next sublist in in the sequence. So input </p>
  
  <pre><code>{"a", "b", "c", "d", "e", "f", "g", "h"}
  </code></pre>
  
  <p>would result in</p>
  
  <pre><code>{"a", "d", "g"}, {"b", "e", "h"}, {"c", "f"}
  </code></pre>
  
  <p>I've done it this way but I'm sure there must be a way to express this more elegantly using LINQ.</p>
  
  <pre><code>var input = new List&lt;string&gt; {"a", "b", "c", "d", "e", "f", "g", "h"};
  var list = new List&lt;string&gt;[3];
  
  for (int i = 0; i &lt; list.Length; i++)
      list[i] = new List&lt;string&gt;();
  
  int column = 0;
  foreach (string letter in input)
  {
      list[column++].Add(letter);
      if (column &gt; 2) column = 0;
  }
  </code></pre>