//for-in
/*
for 迭代变量 in集合变量
{
使用迭代变量便利所有数据
}
*/
//遍历数组
var arr = ["a" ,"b" ,"c" ,"d"]
for tempin
arr
{
print(temp)
print("\t")
}
//
var array:[(String,Int,String)]
= [("张三",20,"男"),("王三",30,"男"),("张浩",50,"女")]
for vin
arr
{
if v.0 =="王三"
{
print(v)
break
}
}
版权声明:本文为博主原创文章,未经博主允许不得转载。