For example I'd like to replace all occurrences of @"a" and @"b" in @"abcdabcd" with @"z". I'm currently doing this with repeated called to stringByReplacingOccurencesOfString:withString::
NSString *s1 = @"abcdabcd";
NSString *s2 = [[s1 stringByReplacingOccurencesOfString:@"a" withString:@"z"]
stringByReplacingOccurencesOfString:@"b" withString:@"z"];
What's a better way? I didn't find any similar methods that take an array of strings to replace.