ifEmpty

fun <T> Sequence<T>.ifEmpty(defaultValue: () -> Sequence<T>): Sequence<T>(source)

Returns a sequence that iterates through the elements either of this sequence or, if this sequence turns out to be empty, of the sequence returned by defaultValue function.

Since Kotlin

1.3

Samples