filter Indexed To
abstract fun <C : MutableCollectionWrapper<in T>> filterIndexedTo(destination: C, predicate: (index: Int, T) -> Boolean): C
将此可迭代对象中满足给定 predicate 的所有元素添加到 destination 中, 并提供元素的索引。
Return
destination,以便链式调用。
Parameters
destination
用于存储结果的 MutableCollectionWrapper。
predicate
用于测试每个元素的函数,接收元素的索引和元素本身作为参数。