XD blog

blog page

union


2014-12-19 Example in C# and unions of enumerables

I often how to compute the concatenation of several lists in C# using Linq.

var iterator = new List<List<string>> () ... ;
var union = iterator.Aggregate( (a,b) => a.Concat(b) ) ;  // enumerate on strings

And if you are looking to a page easy which gives you many examples, that should be this one: 101 LINQ Samples.


Xavier Dupré