特牛网址导航

Scala 之 占位符(即下划线)语法一_"scala line=>line.split(\"\\\\s+\")改写为占位符写法"-CSDN博客

网友收藏
文章浏览阅读253次。scala> val someNumbers = List(-11, -10, -5, 0, 5, 10)someNumbers: List[Int] = List(-11, -10, -5, 0, 5, 10)scala> someNumbers.filter((x: Int) => x > 0)res1: List[Int] = List(5, 10)// 等..._"scala line=>line.split(\"\\\\s+\")改写为占位符写法"