I have an NSMutableString that holds the word twice (e.g. / abc ...................... / abc).
Now I want to replace these two occurrences of / abc with / xyz. I want to replace only the first and last appearance with other cases.
- (NSUInteger)replaceOccurrencesOfString:(NSString *)target
withString:(NSString *)replacement
options:(NSStringCompareOptions)opts
range:(NSRange)searchRange
I find this NSMutableString instance method, but I cannot use it in my case. Anyone have any solution?
source
share