Search This Blog

Thursday, March 3, 2016

Concatenate list of strings c#

C#>  Enumerable > Aggregate

Aggregate performs a calculation over a sequence of values.

Example


List<string> items = new List<string>() { "1", "2", "3", "4" };

var x = items.Aggregate((a, b) => a + "," + b); // "1,2,3,4"