title: Generic List to CSV String
body: <p>I have a list that I want to write to a CSV string.</p>
  
  <p>The examples I have found all seem to be for single item lists, mine has multiple items.</p>
  
  <p>The code I currently have is;</p>
  
  <pre><code>private static string CreateCSVTextFile&lt;T&gt;(List&lt;T&gt; data, string seperator = ",") where T : ExcelReport, new()
  {
    var objectType = typeof(T);
    var properties = objectType.GetProperties();
    var currentRow = 0;
    var returnString = "";
    foreach (var row in data)
    {
      var currentColumn = 0;
      var lineString = "";
      foreach (var info in properties)
      {
        lineString = lineString + info.GetValue(row, null) + seperator;
        currentColumn++;
      }
      if (seperator != "")
      {
        lineString = lineString.Substring(0, lineString.Count() - 2);
      }
      returnString = returnString + Environment.NewLine + lineString;
      currentRow++;
    }
    return returnString;
  }
  </code></pre>
  
  <p>But when the list is large this method takes a very long time to run.</p>
  
  <p>The class my list is based on looks like;</p>
  
  <pre><code>internal class ClientMasterFile
  {
  public String COL1{ get; set; }
  public String COL2{ get; set; }
  public String COL3{ get; set; }
  public String COL4{ get; set; }
  public String COL5{ get; set; }
  public String COL6{ get; set; }
  public String COL7{ get; set; }
  public String COL8{ get; set; }
  public String COL9{ get; set; }
  public String COL10{ get; set; }
  public String COL11{ get; set; }
  public String COL12{ get; set; }
  }
  </code></pre>
  
  <p>Is there a faster way to do this using an advanced version of String.Join?</p>
  
  <p>Thanks</p>