Sorry for the weird caption. What I’m trying to achieve is simple:
IEnumerable<IEnumerable<Foo>> listoflist;
IEnumerable<Foo> combined = listoflist.CombineStuff();
Example:
{{0, 1}, {2, 3}} => {0, 1, 2, 3}
I’m positive there is a Linq expression for this…
Sidenote: The lists may be large.
As leppie says, you want
Enumerable.SelectMany. The simplest form would be:In query expressions,
SelectManyis called when you have more than onefromclause, so an alternative would be: