好方便啊~
使用 array 的 removeAll方法
移除如下数组中值为7的元素
var numbers = [1, 2, 3, 4, 5, 6, 7]
numbers.removeAll(where: { $0 == 7})
好方便啊~
使用 array 的 removeAll方法
移除如下数组中值为7的元素
var numbers = [1, 2, 3, 4, 5, 6, 7]
numbers.removeAll(where: { $0 == 7})
本文标题:Swift 中数组(Array)删除某个元素
本文链接:https://www.haomeiwen.com/subject/mythfrtx.html
网友评论