字符串与数组的转换

1.将字符串数组,拼接成一个字符串
//中间以逗号隔开
NSString *departmentIdArrayStr = [arrM componentsJoinedByString:@","];
 
2.将字符串转换为数组
//以逗号为分隔标志
NSArray  *array = [@"" componentsSeparatedByString:@","];

 

posted @ 2018-04-04 00:24  码出境界  阅读(173)  评论(0编辑  收藏  举报