iOS字符串转数组,数组转字符串

柔情只为你懂 2022-07-12 11:42 695阅读 0赞
  1. NSString *testString = @"1,2,3,4,5";
  2. NSArray *testArray = [testString componentsSeparatedByString:@","];
  3. NSLog(@"testArray=========%@",testArray);
  4. NSString *tempStr = [testArray componentsJoinedByString:@"-"];
  5. NSLog(@"tempStr===========%@",tempStr);

转载请注明出处:http://blog.csdn.net/chen_gp_x

发表评论

表情:
评论列表 (有 0 条评论,695人围观)

还没有评论,来说两句吧...

相关阅读