inline fun <T, R : Any> Array<out T>.mapNotNull(
transform: (T) -> R?
): List<R>
My use case is a little different than this one
Is there any function that I can use in the place of mapNotNull in Java?
val strings: List<String> = listOf("12a", "45", "", "3")
val ints: List<Int> = strings.mapNotNull { it.toIntOrNull() }
println(ints) // [45, 3]