create a comma-separated list of string values from c-sharp string List

Create a comma-separated list of string values.

Comma separated list of string values can easily be created in C# by utilizing the string.Join function.

The code snippet bellow shows it all.

 

IList<string> stringWithCommas = new List<string>{"1","2","testing"};
string joined = string.Join(",", stringWithCommas);