Skip to content

Instantly share code, notes, and snippets.

Created June 20, 2013 10:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5821751 to your computer and use it in GitHub Desktop.
Save anonymous/5821751 to your computer and use it in GitHub Desktop.
// 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