Instance Method (Default implementation)swift 6.0.1Swift

    distance(from:to:)

    Returns the distance between two indices.

    func distance(from start: Self.Index, to end: Self.Index) -> Int

    Parameters

    start

    A valid index of the collection.

    end

    Another valid index of the collection. If end is equal to start, the result is zero.

    Returns

    The distance between start and end. The result can be negative only if the collection conforms to the BidirectionalCollection protocol.

    Unless the collection conforms to the BidirectionalCollection protocol, start must be less than or equal to end.

    Implements

    Other members in extension

    Typealiases

    Show obsolete interfaces (1)

    Hide obsolete interfaces

    Instance members

    Show obsolete interfaces (6)

    Hide obsolete interfaces