Skip to content

anonymous /split.scala
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
// Executed as a Scala script
// Scala version 2.10.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_01)
class Person(firstLast: String) {
val ss = firstLast.trim.split(" ")
println(ss.getClass.getName)
println(ss.length)
ss.zipWithIndex foreach println
}
new Person("John Doe")
// [Ljava.lang.String;
// 3
// (John,0)
// (,1)
// (Doe,2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.