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

prefix(while:)

Returns a lazy sequence of the initial consecutive elements that satisfy predicate. predicateを満足させる、冒頭の隣接要素からなるある遅延シーケンスを返します。

Declaration 宣言

func prefix(while predicate: @escaping (Base.Element) -> Bool) -> LazyPrefixWhileSequence<LazyFilterSequence<Base>>

Parameters パラメータ

predicate

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