c# list join comma code example
Example 1: c# list to string comma separated
IList<string> strings = new List<string>{"1","2","testing"};
string joined = string.Join(",", strings);
Example 2: c# list join
List<string> names = new List<string>() { "John", "Anna", "Monica" };
var result = String.Join(", ", names.ToArray());
Example 3: how to join array indexes with comma in c#
List<string> testList= new List<string>();
testList.Add("Apple");
testList.Add("Banana");
testList.Add("Mango");
testList.Add("Blue Berry");
testList.Add("Water Melon");
string JoinDataString = string.Join(",", testList.ToArray());