1. NSString 拆分成 NSArray
NSString *_string = @"1,2,3,4,5";
NSArray *_arr = [_string componentsSeparatedByString:NSLocalizedString(@",", nil)];
2. NSArray 转为 NSString
NSArray *_arr = [[NSArray alloc] initWithObjects:@"1", @"2", @"3", @"4", @"5", nil];
NSString *_str = [_arr componentsJoinedByString:@","]; |
|