Try this:
val x: String = list.mkString
This syntax:
for (i <- list) yield i
is syntactic sugar for:
list.map(i => i)
and will thus return an unchanged copy of your original list
.
Try this:
val x: String = list.mkString
This syntax:
for (i <- list) yield i
is syntactic sugar for:
list.map(i => i)
and will thus return an unchanged copy of your original list
.