I am trying to replace only one of the NSString occurrences with another string. I know that you can use stringByReplacing * Occurrences * OfString ; however, this replaces all occurrences. What I'm looking for is more like stringByReplacing * Occurrence * OfString . If anyone could help me, that would be great. Thanks, Jnani
Something like that?
NSRange location = [someString rangeOfString:stringToReplace]; NSString* result = [someString stringByReplacingCharactersInRange:location withString:stringToReplaceWith];