https://kotlinlang.org logo
#getting-started
Title
# getting-started
r

Ray Rahke

03/09/2024, 1:32 AM
Copy code
private fun format(message: String): Pair<String, List<String>> {
        val tokens = message.split(" ")
        val (keyword, parameters) = (tokens[0], tokens.slice(1))
Unexpected tokens (use ';' to separate expressions on the same line)?? kotlin supports destructuring right?
a

asdf asdf

03/09/2024, 2:02 AM
Kotlin does not have tuple literal syntax, instead you would use
val (a, b) = foo() to bar()
. Not really sure why you want to do this though as you can just make it with 2 separate variable declarations
r

Ray Rahke

03/09/2024, 2:07 AM
Not really sure why you want to do this though as you can just make it with 2 separate variable declarations
that's why lol