Closed imzyf closed 6 years ago
http://www.jianshu.com/p/26d9201ef479
let s = " / 2 3 4 ? / " // 替换 print("空格替换成-:", s.replacingOccurrences(of: " ", with: "-")) // 过滤 print("空格过滤掉:", s.replacingOccurrences(of: " ", with: "")) // 去首尾空格 print("去掉空格:", s.trimmingCharacters(in: .whitespaces)) // 分割 print("分割:", s.components(separatedBy: "/")) // 拼接 let a = ["1", "2", "3"] print("拼接:", a.joined(separator: "-"))
repeat
http://www.jianshu.com/p/26d9201ef479