Kotlin HashSet mapIndexedNotNull()
Syntax & Examples


Syntax of HashSet.mapIndexedNotNull()

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

fun <T, R : Any> Iterable<T>.mapIndexedNotNull( transform: (index: Int, T) -> R? ): List<R>

This mapIndexedNotNull() extension function of HashSet returns a list containing only the non-null results of applying the given transform function to each element and its index in the original collection.