Javarsenal y Scala-tore Briatore
Tuesday, April 14, 2015
Pattern match with match-case on lists
val a = ((1 to 3) :\ List[Int]())(_ :: _)
a match {
case x::Nil => println(a)
case _ => println("kk")
}
No comments:
Post a Comment
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment