Kotlin HashSet firstNotNullOf()
Syntax & Examples


Syntax of HashSet.firstNotNullOf()

The syntax of HashSet.firstNotNullOf() extension function is:

fun <T, R : Any> Iterable<T>.firstNotNullOf( transform: (T) -> R? ): R

This firstNotNullOf() extension function of HashSet returns the first non-null value produced by transform function being applied to elements of this collection in iteration order, or throws NoSuchElementException if no non-null value was produced.