1.区间运算符
•闭区间[a,b]-------> a...b
•前闭后开区间[a,b)------->a..<b
2.for-in循环
for 变量名 in 区间
{ ... }
例子:
for index in 1...10{ println("\(index)") //index 是一个常量,不需要显示声明 }
遍历一个数组
var arrays = ["a","b","c","d","e"] for i in 0..<arrays.count { println(arrays[i]) }
3.逻辑运算符
•与---------> a && b
•或---------> a || b
•非---------> !a