1.数组转字符串:
var array = ["1", "2", "3"]
array.joined(separator:"")
如果需要在中间插入字符,则修改""的内容即可
2.Dictionary通过条件过滤:
let data = ["a": 0, "b": 42]
let filtered = data.filter { $0.value > 10 }
print(filtered) // ["b": 42]
1.数组转字符串:
var array = ["1", "2", "3"]
array.joined(separator:"")
如果需要在中间插入字符,则修改""的内容即可
2.Dictionary通过条件过滤:
let data = ["a": 0, "b": 42]
let filtered = data.filter { $0.value > 10 }
print(filtered) // ["b": 42]
本文标题:Swift之数据操作知识总结
本文链接:https://www.haomeiwen.com/subject/guipdctx.html
网友评论