Answers for "How to number numbers in the list in Kotlin"

0

How to number numbers in the list in Kotlin

fun main() {
    println(List(5) { idx -> "No. $idx" })
}

// [No. 0, No. 1, No. 2, No. 3, No. 4]
Posted by: Guest on April-07-2022

Code answers related to "How to number numbers in the list in Kotlin"

Browse Popular Code Answers by Language