1. 数组
- 创建一个空数组
var ints = [Int]() // []
ints.append(3) // [3]
ints = [] // []
// ["Roy", "Lily", "Bob"]
var names = ["Roy","Lily","Bob"]
// ["Roy", "Lily", "Bob", "Break"]
names += ["Break"]
var ints = [Int]() // []
ints.append(3) // [3]
ints = [] // []
// ["Roy", "Lily", "Bob"]
var names = ["Roy","Lily","Bob"]
// ["Roy", "Lily", "Bob", "Break"]
names += ["Break"]
本文标题:Swift 集合类型
本文链接:https://www.haomeiwen.com/subject/cnewvftx.html
网友评论