Answers for "how to invert list kotlin"

0

how to invert list kotlin

import java.util.Collections
 
fun main() {
    val days: List<String> = listOf("Sunday", "Monday", "Friday")
 
    Collections.reverse(days)
 
    println(days)            // [Friday, Monday, Sunday]
}
Posted by: Guest on March-03-2021

Browse Popular Code Answers by Language