Instance Method インスタンスメソッド

distance(from:to:)

Returns the distance between two indices. 2つのインデックス間の隔たりを返します。

Declaration 宣言

func distance(from start: Int, to end: Int) -> 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. コレクションの別の有効なインデックス。endstartに等しいならば、結果はゼロです。

Return Value 戻り値

The distance between start and end. startendの隔たり。

Relationships 関係

From Protocol 由来プロトコル

See Also 参照

Manipulating Indices インデックスを操る