[Solved] Separate strings from given string


Below code will give you result as you specified in question.

BEWARE !!! – This code only works for static symbols combination mention in your question {{{ and }}}. If any change made in that combination than you will not have desired result.

NSString *str = @"Hello {{{sepearte this}}} and also this {{{ also seperate this}}} world";

str = [str stringByReplacingOccurrencesOfString:@" {{{" withString:@"#"];
str = [str stringByReplacingOccurrencesOfString:@"}}} " withString:@"#"];
NSArray *components = [str componentsSeparatedByString:@"#"];

solved Separate strings from given string