There are also variants of the mkString methods called addString which append the constructed string to a StringBuilder object
The mkString and addString methods are inherited from List’s supertrait Traversable, so they are applicable to all other collections, as well.
object List_StringBuilder extends App{
val lst=List("america","india")
val buf = new StringBuilder
println(lst addString (buf, "(", ";", ")"))
//stringbuilder object
}
(america;india)