func dropFirst (Int) -> AsyncDropFirstSequence<AsyncLineSequence<Base>>
func drop(while: (String) -> Bool) -> AsyncDropWhileSequence<AsyncLineSequence<Base>>
Availability 有効性
Technology
func filter(_ isIncluded: @escaping (String
) async -> Bool
) -> AsyncFilterSequence
<AsyncLineSequence
<Base>>
isIncluded
A closure that takes an element of the asynchronous sequence as its argument and returns a Boolean value that indicates whether to include the element in the filtered sequence. あるクロージャ、それは非同期シーケンスの1つの要素をそれの引数として取り、その要素をこの平坦化されたシーケンスに含むことになるかどうかを指し示すブール値を返します。
An asynchronous sequence that contains, in order, the elements of the base sequence that satisfy the given predicate. ある非同期シーケンス、それは基底シーケンスの要素それらを、順番に含みます、それらは与えられた述部を満たすものです。
In this example, an asynchronous sequence called Counter
produces Int
values from 1
to 10
. The filter(_:)
method returns true
for even values and false
for odd values, thereby filtering out the odd values:
この例において、Counter
と呼ばれる非同期シーケンスはInt
値を1
から10
まで生み出します。filter(_:)
メソッドは、true
を偶数値に対してそしてfalse
を奇数値に対して返します、それによって奇数値を取り除いています:
let stream = Counter(howHigh: 10)
.filter { $0 % 2 == 0 }
for await number in stream {
print("\(number) ", terminator: " ")
}
// Prints: 2 4 6 8 10
func dropFirst (Int) -> AsyncDropFirstSequence<AsyncLineSequence<Base>>
func drop(while: (String) -> Bool) -> AsyncDropWhileSequence<AsyncLineSequence<Base>>