字符串和数组的互相转换

2016-09-11  本文已影响34人  CoffeeKid

不要再傻傻地用for循环拼或者拆分了
数组转字符串:array.componentsJoinedByString
字符串转数组:string.componentsSeperatedByString

更新一下:

更新到swift3.0以后,componentsJoinedByString简化为joined(separator:)

上一篇 下一篇

猜你喜欢

热点阅读