let boy = (10,"boy")
switch boy{
case (0...20,"boy"):
println("boy")
case (21...100,"man"):
println("man")
default:
println("其他")
}
//输出:boy
转载于:https://my.oschina.net/t5xgkow/blog/509992
let boy = (10,"boy")
switch boy{
case (0...20,"boy"):
println("boy")
case (21...100,"man"):
println("man")
default:
println("其他")
}
//输出:boy
转载于:https://my.oschina.net/t5xgkow/blog/509992