Created
June 20, 2013 10:35
-
-
Save anonymous/5821751 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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