Skip to content
FutureBlitz

    Install

    Import std.collections.array

    Sorting

    std.collections.array

    struct

    Public Struct Sorting<T>

    An array SortBy or SortByDescending sorted, whose ThenBy and ThenByDescending sort it again where the keys so far tie, in place.

    Examples

    Local words = ["bb", "a", "ccc", "dd"]
    words.SortBy(Function(w: String) => w.Length).ThenByDescending(Function(w: String) => w)
    Expect(words == ["a", "dd", "bb", "ccc"])

    std/collections/array.fb, line 514

    • @PanicsAtCaller Public Method ThenBy<K: Comparable>(key: Func(T): K): Sorting<T> method #

      Sorts the array again by what key gives, smallest first, where the keys so far tie.

    • @PanicsAtCaller Public Method ThenByDescending<K: Comparable>(key: Func(T): K): Sorting<T> method #

      The same, largest key first.

    Report an issue with this page or with FutureBlitz on GitHub.