iOS替换HTML中的标签

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

-(NSString *)filterHTML:(NSString *)str
{  
    NSScanner * scanner = [NSScanner scannerWithString:str];  
    NSString * text = nil;  
    while([scanner isAtEnd]==NO)  
    {  
        //找到标签的起始位置  
        [scanner scanUpToString:@"<" intoString:nil];  
        //找到标签的结束位置  
        [scanner scanUpToString:@">" intoString:&text];  
        //替换字符  
        str  =  [str  stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"%@>",text] withString:@""];  
    }  

    return str;  
}