title: Use LINQ to Convert a List to a List of Lists
body: <p>I have a list of values:</p>
  
  <pre><code>IList&lt;V&gt; values = { V1, V2, V3, V4, V5, V6, V7 };
  </code></pre>
  
  <p>I would like to convert the list into a list of lists, where each sub-list is a specified size. The size of each sub-list could vary.  For example:</p>
  
  <pre><code>IList&lt;IList&lt;V&gt;&gt; values_size2 = { { V1, V2 }, { V3, V4 }, { V5, V6 }, { V7 } };
  IList&lt;IList&lt;V&gt;&gt; values_size3 = { { V1, V2, V3 }, { V4, V5, V6 }, { V7 } };
  IList&lt;IList&lt;V&gt;&gt; values_size4 = { { V1, V2, V3, V4 }, { V5, V6, V7 } };
  </code></pre>
  
  <p>I could probably do this pretty easily using nested loops, but was wondering if there was a clever way to do this using LINQ?</p>
  
  <p>My initial thought would be to use the <a href="http://msdn.microsoft.com/en-us/library/system.linq.enumerable.aggregate.aspx" rel="nofollow">Aggregate</a> method somehow, but nothing comes to mind right away.</p>
  
  <p>Thanks.</p>