字符串转数组:
let str ="1,2,3"
let array= str.components(separatedBy:",")
数组转字符串:
let array = ["1","2","3"]
let str = array.joined(separator:",")
let str ="1,2,3"
let array= str.components(separatedBy:",")
let array = ["1","2","3"]
let str = array.joined(separator:",")
本文标题:Swift 3.0 字符串和数组转换
本文链接:https://www.haomeiwen.com/subject/ibkkxxtx.html
网友评论