title: Flatten Ruby method in C#
body: <p>How can I do the Ruby method <a href="http://www.ruby-doc.org/core/classes/Array.html#M002241" rel="noreferrer">"Flatten" Ruby Method</a> in C#. This method flattens a jagged array into a single-dimensional array.</p>
  
  <p>For example:</p>
  
  <pre><code>s = [ 1, 2, 3 ]           #=&gt; [1, 2, 3]
  t = [ 4, 5, 6, [7, 8] ]   #=&gt; [4, 5, 6, [7, 8]]
  a = [ s, t, 9, 10 ]       #=&gt; [[1, 2, 3], [4, 5, 6, [7, 8]], 9, 10]
  a.flatten                 #=&gt; [1, 2, 3, 4, 5, 6, 7, 8, 9, 10
  </code></pre>