标签:ping bsp pow -- ble nts font 类型 默认值
数组
1.创建一个数组
var someInts = [Int]()空数组
someInts = []清空
var threeDoubles = Array(repeating: 0.0, count: 3)有默认值的数组
var shoppingList: [String] = ["Eggs", "Milk"]
var arra = arrb + arrc创建一个数组是另两个数组的相加
2.array.count
3.array.isEmpty
4.加元素
array.append("Flour")
array += ["Baking Powder"]
5.插入
array.insert("Maple Syrup", at: 0)
6.删除
let a = array.remove(at: 0)
7.遍历
for item in array {
print(item)
}
for (index, value) in array.enumerated() {
print("Item \(index + 1): \(value)")
}
标签:ping bsp pow -- ble nts font 类型 默认值
原文地址:http://www.cnblogs.com/huoran1120/p/6114097.html