how to add concatenate multiple NSString in one String in iphone

后端 未结 6 1424
有刺的猬
有刺的猬 2020-12-31 08:19

I have 5 String i want that they must be store in singe NSString all the values separate with | sign

   NSString *first=@\"Ali\";
   NSString *         


        
6条回答
  •  佛祖请我去吃肉
    2020-12-31 09:02

    NSArray *myStrings = [[NSArray alloc] initWithObjects:first, second, third, fourth, fifth, nil];
    NSString *joinedString = [myStrings componentsJoinedByString:@"|"];
    // release myStrings if not using ARC.
    

提交回复
热议问题