zipWithNext

Returns a list of pairs of each two adjacent characters in this char sequence.

The returned list is empty if this char sequence contains less than two characters.

Since Kotlin

1.2

Samples


inline fun <R> CharSequence.zipWithNext(transform: (a: Char, b: Char) -> R): List<R>(source)

Returns a list containing the results of applying the given transform function to an each pair of two adjacent characters in this char sequence.

The returned list is empty if this char sequence contains less than two characters.

Since Kotlin

1.2

Samples