内容:
1、Ectracter提取器代码实战
2、Ectracter源码解析
def match_array(arr : Any) = arr match {
case Array(0) => println("Array:" + "0")
case Array(x, y) => println("Array:" + x + " " +y)
case Array(0, _*) => println("Array:" + "0 ...")
case _ => println("something else")
}
match_array(Array(0))
match_array(Array(0,1))
match_array(Array(0,1,2,3,4,5))
模式匹配中将匹配的内容提取出来,如case2