https://kotlinlang.org logo
#announcements
Title
# announcements
f

frellan

03/28/2018, 8:05 PM
Is there a way to deconstruct a pair and define both a
var
and
val
in the same call? Or reassign and declare in the same call? Currently I have to do this and its not so nice.
Copy code
var line = input

val (lineWithoutParenthesis, parenthesis) = extractParenthesis(line)
line = lineWithoutParenthesis.trim()
val (lineWithoutAlternatives, alternativeStrings) = extractAlternativeStrings(line)
line = lineWithoutAlternatives.trim()