countElements()计算字符串长度。
比较字符串相等, ==。
字符串判空。isEmpty
字符串转换成int。toInt()
int?
!
nil
shoppingList.insert("abc",atIndex:0)
shoppingList.append("abc","bac")
shoppingList.removeAtIndex(0) //返回删除值
shoppingList.count//数组长度
for item in shoppingList {
println(item)
}
for(index, value) in enumerate(shoppingList) {
....
}
airports["LHR"] = "London"
airports.removeValueForKey()
airports.count
for(airportCode, airportName) in airports{
}
for(airportCode in airports.keys {
}
for(airportName in airports.values {
}
let airportCodes = Array(airports.keys)
原文地址:http://blog.csdn.net/jason_wang1989/article/details/43701117