字符串拆分为数组
let str = "hello world"
// 1、
let sepArr = str.components(separatedBy: " ")
// 2、
//let sepArr = str.split(separator: " ")
// 3、
//let sepArr = str.split{$0 == " "}.map(String.init)
print(sepArr)
数组组合为字符串
let sepArr = ["hello", "world"]
let joinStr = sepArr.joined(separator: ",")