« MoreLINQ » : différence entre les versions
De Banane Atomic
Aller à la navigationAller à la recherche
Aucun résumé des modifications |
|||
Ligne 11 : | Ligne 11 : | ||
= Operators = | = Operators = | ||
== [https://github.com/morelinq/examples/blob/master/m/aggregate.md Aggregate] == | == [https://github.com/morelinq/examples/blob/master/m/aggregate.md Aggregate] == | ||
== | == Batch == | ||
Batches the source sequence into sized buckets. | |||
<kode lang='cs'> | <kode lang='cs'> | ||
Enumerable | |||
.Range(1, 10) | |||
.Range(1, | .Batch(3); // split the sequence into sequences of max length 3 | ||
. | // [1, 2, 3] | ||
// [4, 5, 6] | |||
// | // [7, 8, 9] | ||
// [10] | |||
// | |||
// | |||
</kode> | </kode> |
Version du 14 novembre 2020 à 22:31
Links
Add
dotnet add package MoreLINQ |
Operators
Aggregate
Batch
Batches the source sequence into sized buckets.
Enumerable .Range(1, 10) .Batch(3); // split the sequence into sequences of max length 3 // [1, 2, 3] // [4, 5, 6] // [7, 8, 9] // [10] |