zipWithNext method

  1. @useResult
KtList<KtPair<T, T>> zipWithNext()

Returns a list of pairs of each two adjacent elements in this collection.

The returned list is empty if this collection contains less than two elements.

Implementation

@useResult
KtList<KtPair<T, T>> zipWithNext() =>
    zipWithNextTransform((a, b) => KtPair(a, b));