I'm trying to transform a sequence like the one bellow
val raw: Seq[String] = Seq("timmy barns", "jimmy smith", "mark middle")
into a sequence that would look like this.
val parsed: Seq[(String, String)] = Seq(("timmy", "barns"), ("jimmy", "smith"), ("mark", "middle"))
The best I can come up with is something like this.
val parsed: Seq[(String, String)] = Seq(raw.map(i => i.split(" ")))
Obviously this won't work, can anyone give me suggestions?