distance(from:to:)
Returns the distance between two indices.
Declaration
func distance(from start: Self.Index, to end: Self.Index) -> Self.Index.StrideParameters
- start:
A valid index of the collection.
- end:
Another valid index of the collection. If
endis equal tostart, the result is zero.
Return Value
The distance between start and end.