I have the following list in input and :
val list=List("aimee,Paris,10",
"alex,Nice,12",
"Sara,Paris,15")
and I want to have a multiline String as output with the following format:
val output:String="aimee Paris,
alex Nice,
Sara Paris")
I wrote the following code
def listToMultLine (input:List[String]):String ={
input.map(_.split(",")).map(x => List(x(0),x(1)).mkString(","))
}
but this gives me erronous output thanks a lot for your help