List の使い方(続き3) - あるプログラマの日記

リスト先頭から指定要素数の後のリストを得る。( drop ) scala> val foo = List(4, 5, 6, 7) foo: List[Int] = List(4, 5, 6, 7) scala> foo.drop(2) res0: List[Int] = List(6, 7) scala> foo.drop(1) res1: List[Int] = List(5, 6, 7) scala> foo.drop(3) res2: List[Int] = List(7) リスト先頭から指定要素数のリストを…