How do I "join" an iterable of strings by another string in Scala?
val thestrings = Array("a","b","c")
val joined = ???
println(joined)
I want this code to output a,b,c
(join the elements by ",").
Success story sharing
def mkFoldLeftString[A](list:List[String], delim:String = ","): String = list match { case head :: tail => tail.foldLeft(head)(_ + delim + _) case Nil => "" }