Kotlin List – zip() + zipWithNext()
In the tutorial, we will show how to use zip() and zipWithNext() methods of Kotlin List collection.
I. zip() method
Use below method signatures:
infix fun Iterable.zip( other: Array ): List> infix fun Iterable.zip( other: Iterable ): List>
-> Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection.