Can you please correct my code.I am trying to print x22 by spliting x11.
object ScalaString {
def main(args: Array[String]): Unit = {
var x =" Hello world"
x.filter(_!='l').foreach(println)
//for(c <- x) println(c)
println(x.stripPrefix(" ").drop(2).take(2).capitalize)
**var x11=" hello|world|india"
var x22=( x11.split("|").map(_.trim()))
println(x22.toString())**
}
}
output:
w
o
r
d
Ll
**[Ljava.lang.String;@56431753**