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

posted @ Monday, December 15, 2008 4:54 PM

Print
Comments have been closed on this topic.
«September»
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789