kotlin.sequences.elementAtOrNull

elementAtOrNull

fun <T> Sequence<T>.elementAtOrNull(index: Int): T?

Returns an element at the given index or null if the index is out of bounds of this sequence.