componentsJoinedByString 和 componentsSeparatedByString 的方法的区别
生活随笔
收集整理的這篇文章主要介紹了
componentsJoinedByString 和 componentsSeparatedByString 的方法的区别
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
將string字符串轉換為array數組
?NSArray? *array = [Str componentsSeparatedByString:@","];
==反向方法
將array數組轉換為string字符串
?NSString *tempString = [mutableArray componentsJoinedByString:@","];--,是分隔符
可不加分隔符,就直接連接成字符串
?NSString *tempString = [mutableArray componentsJoinedByString:@""];
總結
以上是生活随笔為你收集整理的componentsJoinedByString 和 componentsSeparatedByString 的方法的区别的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: iOS 富文本风格NSMutablePa
- 下一篇: NSString拼接字符串和NSPred