title: Convert multidimensional Array (Object[,]) to string[]
body: <p>I'm stuck in an easy task: convert an multidimensional Array (Object[,]) in a monodimensional string[].</p>
  
  <p>Long story short: I'm reading an excel file using a com library which returns a dynamic type casted to Object[,] at runtime.</p>
  
  <pre><code>SortedSet&lt;string&gt; rows = new SortedSet&lt;string&gt;();
  for (int i = 3; i &lt;= 5; i++) 
  {
      Microsoft.Office.Interop.Excel.Range range = worksheet.get_Range("A"+i, "J"+i);
      Array cells = (Array) range.Cells.Value; // value return dynamic [,] -&gt; Object[,] -&gt; cast to Array[,]
      string[] rowCells = ConvertArrayToStringArray(cells); // 
      rows.Add(string.Join("\t", rowCells));
  }
  return string.Join("\r\n", rows);
  </code></pre>
  
  <p>Since Array[,] always have 1 row (I read the excel file row by row) I'd like to cast it to a simple string[] (or List) without using another loop in ConvertArrayToStringArray function.</p>
  
  <p>I could read all cells in an action (not row by row like in code above), but I've no idea of how many rows are in excel file.</p>
  
  <p>I appreciate any help</p>