Swift 3.0字符串 根据某些文字,截取字符串 生成数组
2016-12-06 本文已影响20人
梁同桌
let str = http://ac-rujdcqwh.clouddn.com/b2bbde962fd70acaff5e.jpg", "http://ac-rujdcqwh.clouddn.com/h4xPPTS1N5e1BEpPifduBTD"
let strArray = str.components(separatedBy: ",")//拆分为数组
print(strArray)
//打印
//["http://ac-rujdcqwh.clouddn.com/b2bbde962fd70acaff5e.jpg", "http://ac-rujdcqwh.clouddn.com/h4xPPTS1N5e1BEpPifduBTD"]
- -给力