//字符串转换成数组 关键字:componentsSeparatedByString
NSArray * array = [@"1,2,3,4,5,6,7,8,9" componentsSeparatedByString:@","];
NSLog(@"%@",array);
NSMutableArray * array1 = [NSMutableArray arrayWithArray:array];
NSLog(@"%@",array1);
//数组转换成字符串 关键字:
NSString * str1 = [array1 componentsJoinedByString:@"--"];
NSLog(@"%@",str1);
NSMutableString * str = [NSMutableString stringWithString:str1];
NSLog(@"%@",str);
|
|