Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有一种简单的方法可以将remaining以下代码转换为一维数组。
remaining
var groups = data.OrderBy(d => d.Time).GroupBy(d => d.Period); var first = groups.First().ToArray(); var remaining = groups.Skip(1).??
var remaining = groups.Skip(1).SelectMany(g=>g).ToArray();
用于SelectMany“展平”集合的集合:
SelectMany
var remaining = groups.Skip(1).SelectMany(d => d).ToArray();