let boy = (10,"boy")
switch boy{
case (0...20,"boy"):
println("boy")
case (21...100,"man"):
println("man")
default:
println("其他")
}
//输出:boy
本文共 187 字,大约阅读时间需要 1 分钟。
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