title: Flatten an array of objects that may contain arrays
body: <p>I have an <code>IEnumerable&lt;object&gt;</code> which may or may not contain some nested collections. For example, my starting point might look something like this:</p>
  
  <pre><code>[ "foo", 2, [1, 2, 3, 4], "bar" ]
  </code></pre>
  
  <p>And I want to flatten it to:</p>
  
  <pre><code>[ "foo", 2, 1, 2, 3, 4, "bar" ]
  </code></pre>
  
  <p>I'm thinking a <code>SelectMany</code> should work here but can't quite find the right combination. I could brute force it, but I thought there should be a more elegant solution.</p>