There are a couple of different ways to remove HTML tags
from an NSString
in Cocoa
.
One way is to render the string into an
An updated answer for @m.kocikowski that works on recent iOS versions.
-(NSString *) stringByStrippingHTMLFromString:(NSString *)str {
NSRange range;
while ((range = [str rangeOfString:@"<[^>]+>" options:NSRegularExpressionSearch]).location != NSNotFound)
str = [str stringByReplacingCharactersInRange:range withString:@""];
return str;
}