naturalcasecmpTo(_:)

    Performs a case-sensitive, natural order comparison to another string. Returns -1 if less than, 1 if greater than, or 0 if equal. “Less than” or “greater than” are determined by the Unicode code points of each string, which roughly matches the alphabetical order.

    StringName.swift:174
    final func naturalcasecmpTo(_ to: String) -> Int64

    When used for sorting, natural order comparison orders sequences of numbers by the combined value of each digit as is often expected, instead of the single digit’s value. A sorted sequence of numbered strings will be ["1", "2", "3", ...], not ["1", "10", "2", "3", ...].

    With different string lengths, returns 1 if this string is longer than the to string, or -1 if shorter. Note that the length of empty strings is always 0.

    To get a [bool] result from a string comparison, use the == operator instead. See also naturalnocasecmpTo(to:), nocasecmpTo(to:), and casecmpTo(to:).

    Other members in extension

    Typealiases

    Type members

    Instance members