any idea on how can I do this from scala to Kotlin...
# announcements
m
any idea on how can I do this from scala to Kotlin?:
Copy code
List(1,2) match {
  case x :: xs => println(x + " " + xs)
  case _ => println("")
}
d
Copy code
val list = listOf(1, 2)
if (list.size >= 2) {
    println(list[0] + " " + list.drop(1))
} else {
    println("")
}
👍🏻 1
d
when { list.size == 2 -> println("${list[0]} ${list[1]}") else -> println("") }
d
That's not the same it only prints elements at 0 and 1, the original code prints element 0 and "the rest".