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

来源:互联网 发布:四川广电网络客服电话 编辑:程序博客网 时间:2024/06/01 07:38

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

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

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

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

//将字符串拆分成数组

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

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

0 0
原创粉丝点击