如何使用LINQ
(或其他方法)将一个IEnumerable
的IEnumerables
拆分为一个扁平的IEnumerable
?
如何使用LINQ
(或其他方法)将一个IEnumerable
的IEnumerables
拆分为一个扁平的IEnumerable
?
enumerable.SelectMany(x => x)
var result = from e in enumerables
from v in e
select v;
IEnumerable<IEnumerable<int>> number_collections = ...
IEnumerable<int> collection = number_collections.SelectMany(x => x);