字符串拆分成数组,数组组合成字符串

2017-05-10  本文已影响0人  阿弥陀_丸

NSArray* array=@[@"test1",@"test2",@"test3",@"test4",@"test5",@"test6",@"test7"];

//将数组合并成一个字符串

NSString* appendStr=[array componentsJoinedByString:@" "];

NSLog(@"appendStr=%@",appendStr);

//将字符串拆分成数组

NSArray* resolutionArray=[appendStr componentsSeparatedByString:@" "];

NSLog(@"resolutionArray=%@",resolutionArray);

上一篇下一篇

猜你喜欢

热点阅读