Created
January 4, 2015 13:24
-
-
Save shigemk2/47407d34df926b547fae 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
val a = "hello world".split(" ") | |
println(a) | |
println(a(0)) | |
a.foreach(println) | |
val s = "eggs, milk, butter, Coco Puffs" | |
// 空白が入る | |
s.split(",").foreach(println) | |
// 空白を取り除く | |
s.split(",").map(_.trim).foreach(println) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment