Home > Article > Web Front-end > Remove HTML tags in NSString_html/css_WEB-ITnose
-(NSString *)filterHTML:(NSString *)html
{
NSScanner * scanner = [NSScanner scannerWithString:html];
NSString * text = nil;
while([scanner isAtEnd ]==NO)
{
//Find the starting position of the label
[scanner scanUpToString:@">" intoString:&text];
;
}
NSString * regEx = @"<([^>]*)>";
html = [html stringByReplacingOccurrencesOfString:regEx withString:@""];
return html ;
}
Copyright statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.