flatMapIndexed

@JvmName(name = "flatMapIndexedIterable")
fun <T, R> Sequence<T>.flatMapIndexed(transform: (index: Int, T) -> Iterable<R>): Sequence<R>(source)
@JvmName(name = "flatMapIndexedSequence")
fun <T, R> Sequence<T>.flatMapIndexed(transform: (index: Int, T) -> Sequence<R>): Sequence<R>(source)

Returns a single sequence of all elements yielded from results of transform function being invoked on each element and its index in the original sequence.

The operation is intermediate and stateless.

Since Kotlin

1.4

Samples