I want to replace several different groups of characters in one NSString. Currently I am doing it with several repeating methods, however I am hoping there is a way of doing this in one method:
NSString *result = [html stringByReplacingOccurrencesOfString:@"<B&" withString:@" "];
NSString *result2 = [result stringByReplacingOccurrencesOfString:@"</B>" withString:@" "];
NSString *result3 = [result2 stringByReplacingOccurrencesOfString:@"gt;" withString:@" "];
return [result3 stringByReplacingOccurrencesOfString:@" Description " withString:@""];
I don’t think there is anything in the SDK, but you could at least use a category for this so you can write something like this:
… by using something like the following:
In modern Objective C with ARC: