Answers for "how to get index of item in arraylist in kotlin"

0

how to get index of item in arraylist in kotlin

val b: List<Int> = a.mapIndexed { i, b -> if (b) i else null }.filterNotNull().toList()
val c: List<Int> = a.withIndex().filter { it.value }.map { it.index }
Posted by: Guest on October-02-2020

Code answers related to "how to get index of item in arraylist in kotlin"

Browse Popular Code Answers by Language