title: How can I split an array into n parts?
body: <p>I have a list of bytes and I want to split this list into smaller parts.</p>
  <pre><code>var array = new List&lt;byte&gt; {10, 20, 30, 40, 50, 60};
  </code></pre>
  <p>This list has 6 cells. For example, I want to split it into 3 parts containing each 2 bytes.</p>
  <p>I have tried to write some for loops and used 2D arrays to achieve my purpose but I don't know it is a correct approach.</p>
  <pre class="lang-cs prettyprint-override"><code>byte[,] array2D = new byte[window, lst.Count / window];
  var current = 0;
  for (int i = 0; i &lt; rows; i++)
  {
      for (int j = 0; j &lt; cols; j++)
      {
          array2D[i, j] = lst[current++];
      }
  }
  </code></pre>