C# Snippet - Concatenate list of strings to one colon-separated string

Post date: Dec 25, 2012 10:17:28 PM

List<string> strings = new List<string> { "Peter", "Henell", "Wrote", "This" };string result = String.Join(", ", strings.Select(s => s)); Console.WriteLine(result);

Result:

Peter, Henell, Wrote, This