zip

infix fun <T, R> Sequence<T>.zip(other: Sequence<R>): Sequence<Pair<T, R>>(source)

Returns a sequence of values built from the elements of this sequence and the other sequence with the same index. The resulting sequence ends as soon as the shortest input sequence ends.

The operation is intermediate and stateless.

Since Kotlin

1.0

Samples


fun <T, R, V> Sequence<T>.zip(other: Sequence<R>, transform: (a: T, b: R) -> V): Sequence<V>(source)

Returns a sequence of values built from the elements of this sequence and the other sequence with the same index using the provided transform function applied to each pair of elements. The resulting sequence ends as soon as the shortest input sequence ends.

The operation is intermediate and stateless.

Since Kotlin

1.0

Samples