title: How to write the content of a dictionary to a text file?
body: <p>I have a dictionary object of type Dictionary</p>
  
  <p>and trying to use StreamWriter to output the entire content to a text file but failed to find the correct method from the Dictionary class.</p>
  
  <pre><code>using (StreamWriter sw = new StreamWriter("myfile.txt"))
          {
              sw.WriteLine(dictionary.First());
  
          }
  </code></pre>
  
  <p>I can only retrieve the first element and it is bounded by a square bracket plus a comma separator in between as well:</p>
  
  <p>[Peter, Admin]</p>
  
  <p>and would be nice to have [Peter Admin] (without the comma)</p>