I saw that following answer: Scala split string to tuple, but in the question the OP is asking for a string to a List. I would like to take a string, split it by some character, and convert it to a tuple so they can be saved as vals:
val (a,b,c) = "A.B.C".split(".").<toTupleMagic>
It is unnecessary:
val Array(a, b, c) = "A.B.C".split('.')
Note that I converted the parameter to
Char: if you pass a
String, it is treated as a regex pattern, and
. matches anything (so you'll get an array of empty strings back).
If you truly want to convert it to tuple, you can use Shapeless.