Home »
Code Examples »
Scala Code Examples
Scala - Join an iterable of strings Code Example
The code for Join an iterable of strings
object MyClass {
def main(args: Array[String]) {
val strings = Array("Hello", "Hey", "Hi", "Holla")
// Joining the mkString()
val result = strings.mkString(",")
println("result: " + result)
}
}
/*
Output:
result: Hello,Hey,Hi,Holla
*/
Code by IncludeHelp,
on August 14, 2022 20:32