I have a NSMutableString that contains a word twice.(e.g. /abc ...................... /abc).
Now I want to replace these two occurrences of /abc with /xyz. I want to replace only first and last occurence no other occurences.
- (NSUInteger)replaceOccurrencesOfString:(NSString *)target
withString:(NSString *)replacement
options:(NSStringCompareOptions)opts
range:(NSRange)searchRange
I find this instance method of NSMutableString but I am not able to use it in my case. Anyone have any solution??