val set1=Set("a","b","c")
val set2=Set("c","d","e")
var set3=set1.drop(2)
println(s"set3 drop first tow element : $set3")
val set5=set1 drop 2
println(s"set1 drop first tow element : $set5")
val set6=set1 dropRight 2
println(s"set1 dropRight last tow element : $set6")
// dropWhile 从第一个元素开始匹配,匹配成功后继续向后匹配,匹配失败直接返回,
// 即:他会过滤掉连续匹配的结果且是从第一个元素开始
var seq1=Seq("1","22","333")
val set7=seq1.dropWhile(_.charAt(0)=='1')
println(s"set7 dropWhile element : $set7" )// print: List(22, 333)
// 第一个匹配为false后,将不会继续向后匹配
val set8=seq1.dropWhile(_.charAt(0)=='2')
println(s"set8 dropWhile element : $set8" )// List(1, 22, 333) "22"不会被删除
// 第一个匹配为true后,会继续向后匹配
var seq2=Seq("1","11","22","333")
val set9=seq2.dropWhile(_.charAt(0)=='1')
println(s"set9 dropWhile element : $set9" )// List( 22, 333) "1"和"11"都会被删除