Swift 数组

删除元素
1 | var list = ["1","2","3","4"] |
Swift 数组遍历的几种方式
1. for-in 不带索引
1 | let arr = [Int](7 ..< 10) |
2. forEach 不能使用 break continue ,只能使用 return
1 | let arr = [Int](7 ..< 10) |
3. enumerated() 带索引 和 值
1 | let arr = [Int](7 ..< 10) |
4. while
1 | let arr = [Int](7 ..< 10) |
5. indices 下标索引 遍历下标
1 | let arr = [Int](7 ..< 10) |
区间 for-in 区间 for 循环
1 | let s = 5 |
数组的一些查找操作
1 | let array = [Int](7 ..< 117) |
- Post title:Swift 数组
- Post author:xxxixxxx
- Create time:2020-11-22 00:00:00
- Post link:https://xxxixxx.github.io/2020/11/22/100-Swift-数组/
- Copyright Notice:All articles in this blog are licensed under BY-NC-SA unless stating additionally.
Comments