by shigemk2

当面は技術的なことしか書かない

filter

Scalaコレクションメソッドメモ(Hishidama's Scala collection method Memo)

条件を満たすコレクションを返す。

scala> List(1,2,3,4,5)
res4: List[Int] = List(1, 2, 3, 4, 5)

scala> List(1,2,3,4,5).filter( _ < 5).toString
res5: String = List(1, 2, 3, 4)

scala> List(1,2,3,4,5).toString
res6: String = List(1, 2, 3, 4, 5)

どうでもいいけどREPLでコレクションメソッドの補完って出来ないんですかね。