标签:idt cti -- ret 转义 bsp with str sdi
#pragma mark -- 转义html中的标签
- (NSString *)HTML:(NSString *)html
{
NSScanner *theScaner = [NSScanner scannerWithString:html];
NSDictionary *dict = @{@"&":@"&", @"<":@"<", @">":@">", @" ":@"", @""":@"\"", @"width":@"wid"};
while ([theScaner isAtEnd] == NO) {
for (int i = 0; i <[dict allKeys].count; i ++) {
[theScaner scanUpToString:[dict allKeys][i] intoString:NULL];
html = [html stringByReplacingOccurrencesOfString:[dict allKeys][i] withString:[dict allValues][i]];
}
}
return html;
}
标签:idt cti -- ret 转义 bsp with str sdi
原文地址:http://www.cnblogs.com/guosir/p/6400511.html