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

drop(while:)

Returns a subsequence by skipping elements while predicate returns true and returning the remaining elements. predicatetrueを返す間は要素を飛ばして残りの要素を返すことによって、ある下位シーケンスを返します。

Declaration 宣言

func drop(while predicate: (Element) throws -> Bool) rethrows -> ArraySlice<Element>

Parameters パラメータ

predicate

A closure that takes an element of the sequence as its argument and returns true if the element should be skipped or false if it should be included. Once the predicate returns false it will not be called again. あるクロージャ、それはシーケンスの1つの要素をそれの引数として取り、その要素が省かれるべきならばtrueをまたはそれが含まれるべきならばfalseを返します。いったん述部がfalseを返すならそれは再び呼び出されません。

Discussion 解説

Complexity: O(n), where n is the length of the collection. 計算量:O(n)、ここでnはコレクションの長さです。

See Also 参照

Excluding Elements 要素を除外する