title: Convert 2D array to string in C#, looking for most elegant way
body: <p>I cannot believe there is no smart way to get something like this from a 2D array,<br>
  in this case <code>int[,] a</code>:</p>
  
  <pre><code>"{1,2,3},{4,5,6},{7,8,9}"
  </code></pre>
  
  <p>I have read many similar questions and learned that <code>string.Join()</code> can only be used on jagged arrays (in 2D). But I don't want to use them because of the more complex initialization and because it just feels bad when my rows, which all have the same length, are spread over several places in memory.</p>
  
  <p>This is my "normal" code:</p>
  
  <pre><code>var s = "";
  for (int i = 0; i &lt; a.GetLength(0); i++) {
      if (i &gt; 0) s += ',';
      s += '{';
      for (int j = 0; j &lt; a.GetLength(1); j++) {
          if (j &gt; 0) s += ',';
          s += a[i, j];
      }
      s += '}';
  }
  </code></pre>
  
  <p>And here a "golfed" one:</p>
  
  <pre><code>var s = "{";
  var i = 0;
  foreach (var item in a) s += (i++ &gt; 0 ? i % a.GetLength(1) == 1 ? "},{" : "," : "") + item;
  s += '}';
  </code></pre>
  
  <p>:) - not really elegant, too, and the readability is more than bad.</p>
  
  <p>Any suggestions? I'm open to Linq, since it doesn't have to be fast. I'm interested in improving elegance of the code, but not by just moving it to an extension method.</p>