Convert List into Comma-Separated String
Enjoy!
Console.WriteLine(String.Join(",", new List<uint> { 1, 2, 3, 4, 5 }));
First Parameter: ","
Second Parameter: new List<uint> { 1, 2, 3, 4, 5 })
String.Join will take a list as a the second parameter and join all of the elements using the string passed as the first parameter into one single string.
You can use String.Join method to combine items:
var str = String.Join(",", lst);
Using String.Join
string.Join<string>(",", lst );
Using Linq
Aggregation
lst .Aggregate((a, x) => a + "," + x);