var i = 0
switch i {
case 0:
"0" //被输出
case 1:
"1"
default:
"2"
}
var i = 3
switch i {
case 0,3:
"0" //被输出
case 1:
"1"
default:
"2"
}
var i = 0
switch i {
case 0:
"0" //被输出
fallthrough
case 1:
"1" //被输出
case 2:
"2"
default:
"default"
}
let someOne = ("25","liyuanbo")
switch someOne
{
case (_,let name) where name.hasPrefix("li"):
println("First name has li")
default:
println("First has not li")
}
switch coordinate1
{
case (0,0):
println("原点")
fallthrough
case (_,0):
println("x轴")
fallthrough
case(0,_):
println("y轴")
case(-2...2,-2...2):
println("矩形区域")
default:
println("没有任何目标区域")
}
let coordinate2 = (2,0)
switch coordinate2
{
case (0,0):
println("原点")
case (let x,0):
println("x轴")
case(0,let y):
println("y轴")
case(let x,let y):
println("所有区域")
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有