You can either start off with a List<double>
and use AddRange
, so that you flatten the collections.
(您可以从List<double>
并使用AddRange
,以便展平集合。)
Or you can convert it using SelectMany
, like this: (或者,您可以使用SelectMany
进行转换,如下所示:)
var list = new List<double>();
foreach (...)
{
list.AddRange(someOtherList);
}
// Or
var list = new List<List<double>>();
var flattenedList = list.SelectMany(x => x);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…