NSArray* array=@[@"test1",@"test2",@"test3",@"test4",@"test5",@"test6",@"test7"];
//将数组合并成一个字符串
NSString* appendStr=[array componentsJoinedByString:@" "];
NSLog(@"appendStr=%@",appendStr);
//将字符串拆分成数组
NSArray* resolutionArray=[appendStr componentsSeparatedByString:@" "];
NSLog(@"resolutionArray=%@",resolutionArray);
字符串拆分成数组,数组组合成字符串
最新推荐文章于 2024-04-23 14:30:43 发布