I have a line
NSString * myOldString = @"This is a string (and this part is between brackets)"
Now I want to trim the string so that basically everything between the brackets, including the brackets, is truncated.
More precisely: I do not care what happens after the first bracket.
I can’t make it simple stringByReplacingOccurrencesOfString:because I can’t predict what will happen between the brackets. So, the resulting string should be:
"This is a string"
Sjakelien
source
share