filterIndexedTo

abstract fun <C : MutableCollectionWrapper<in T>> filterIndexedTo(destination: C, predicate: (index: Int, T) -> Boolean): C

将序列中满足指定谓词的所有元素添加到指定的 MutableCollectionWrapper 中,并提供元素的索引。

此函数类似于 Kotlin 标准库中的 filterIndexedTo 函数,但它使用 MutableCollectionWrapper 而不是原始的 MutableCollection

参考 kotlin.sequences.filterIndexedTo

Return

指定的 MutableCollectionWrapper,其中包含添加的元素。

Parameters

destination

用于存储结果的 MutableCollectionWrapper

predicate

一个函数,用于测试每个元素是否满足条件,并提供元素的索引。