commadelimitedstringcollection makes nice csv

just posted this here as a reminder to myself or anyone else looking for a quick way to create a comma-seperated string from a list of things.

public static string ListToCsv<T>(List<T> list)
{
CommaDelimitedStringCollection commaStr = new CommaDelimitedStringCollection();
list.ForEach(delegate(T item)
  {
  commaStr.Add(item.ToString());
   });
       return commaStr.ToString();
}
  -edoode
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
«December»
SunMonTueWedThuFriSat
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910