Reputation: 317
I need to insert a character into a string between each occurrence of strings that I have in an array. For example:
array = [ab,bc,cd,de];
string = @"abbccd";
newString = @"ab*bc*cd";
How can I accomplish this? I looked around but couldn't find a good solution. Thanks.
Upvotes: 0
Views: 274
Reputation: 104082
How about,
NSString *newString = [array componentsJoinedByString:@"*"];
Upvotes: 2