Remove HTML tags in NSString_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:41:41
Original
1265 people have browsed it

-(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.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template