I have an NSString which can have multiple \\n in between the string. I need to replace the multiple occurrence of \\n\'s with a single \\n.
NSString
I tried this co
You can do it in the following way
NSArray *arrSplit = [s componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]]; s = [arrSplit componentsJoinedByString:@"\n"];
Hope it may help you..