Logo

Programming-Idioms

History of Idiom 28 > diff from v25 to v26

Edit summary for version 26 by :
New Csharp implementation by user [javasucks]

Version 25

2016-02-16, 21:58:32

Version 26

2016-02-17, 11:15:03

Idiom #28 Sort by a property

Sort elements of array-like collection items in ascending order of x.p, where p is a field of type Item of the objects in items.

Idiom #28 Sort by a property

Sort elements of array-like collection items in ascending order of x.p, where p is a field of type Item of the objects in items.

Code
Array.Sort(items, (a, b) => compareFunc(a.p, b.p));