title: How to iterate a loop every n items
body: <p>I have a list of items and I need to loop through it so that every n (eg. 3) items are first collected and then processed at once at the n'th item.</p>
  
  <p>I'm doing the following:</p>
  
  <pre><code>List&lt;MyObject&gt; smallList = new List&lt;MyObject&gt;();
  
  for (int i = 0; i &lt; largeList.Count; i++)
  {
      smallList.Add(largeList[i]);
  
      if (i % 3 == 0 || i &gt;= largeList.Count - 3)
      {
          //Do somehting with those n items...
      }
  
      smallList.Clear();
   }
  </code></pre>
  
  <p>Is there a better way to do the above?</p>