gpt4 book ai didi

.net - Linq 到对象 : does GroupBy preserve order of elements?

转载 作者:行者123 更新时间:2023-12-03 04:46:02 25 4
gpt4 key购买 nike

LINQ to Objects 中的 Enumerable.GroupBy 是否保留组中元素的顺序?

最佳答案

MSDN 上找到答案:是的。

The IGrouping<TKey, TElement> objects are yielded in an order based on the order of the elements in source that produced the first key of each IGrouping<TKey, TElement>. Elements in a grouping are yielded in the order they appear in source.

关于.net - Linq 到对象 : does GroupBy preserve order of elements?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1452507/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com