Search code examples
c#ilist

Convert a IList<int> collection to a comma separated list


Any elegant ways of converting a IList collection to a string of comma separated id's?

"1,234,2,324,324,2"


Solution

  •     IList<int> list = new List<int>( new int[] { 1, 2, 3 } );
        Console.WriteLine(string.Join(",", list));