I have 5 String i want that they must be store in singe NSString all the values separate with |
sign
NSString *first=@"Ali";
NSString *second=@"Imran";
NSString *third=@"AliImran";
NSString *fourth=@"ImranAli";
NSString *fifth=@"Ali Imran Jamshed";
I want to all these in single NSString to store and all values separated by given sign.
NSArray *myStrings = [[NSArray alloc] initWithObjects:first, second, third, fourth, fifth, nil];
NSString *joinedString = [myStrings componentsJoinedByString:@"|"];
// release myStrings if not using ARC.
you can try ....
NSString *joinString=[NSString stringWithFormat:@"%@|%@|%@|%@|%@",youstring1,youstring2,youstring3,youstring4,youstring5];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With