去掉NSString中的HTML標籤
{
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;
}