1. 程式人生 > >IOS中的NSString與NSArray的互轉

IOS中的NSString與NSArray的互轉

將string字串轉換為array陣列

 NSArray  *array = [Str componentsSeparatedByString:@","];//分隔符逗號



將array陣列轉換為string字串

 NSString *tempString = [mutableArray componentsJoinedByString:@","];//分隔符逗號

將string字串轉換為array陣列

 NSArray  *array = [Str componentsSeparatedByString:@","];//分隔符逗號



將array陣列轉換為string字串

 NSString *tempString = [mutableArray componentsJoinedByString:@","];//分隔符逗號