标签:
{
NSScanner * scanner = [NSScanner scannerWithString:html];
NSString * text = nil;
while([scanner isAtEnd]==NO)
{
//找到标签的起始位置
[scanner scanUpToString:@"<" intoString:nil];
//找到标签的结束位置
[scanner scanUpToString:@">" intoString:&text];
//替换字符
html = [html stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"%@>",text] withString:@""];
}
NSString * regEx = @"<([^>]*)>";
html = [html stringByReplacingOccurrencesOfString:regEx withString:@""];
return html;
}
转自:http://lqcjdx.blog.163.com/blog/static/2074892412013858133489/
标签:
原文地址:http://www.cnblogs.com/huangzs/p/4480671.html