GXiOS

iOS 替换服务器返回HTML文本中的&nbsp &am

2017-10-12  本文已影响22人  木登与木由
    html = [html stringByReplacingOccurrencesOfString:@"&nbsp" withString:@" "];
    html = [html stringByReplacingOccurrencesOfString:@"&mdash" withString:@"—"];
    html = [html stringByReplacingOccurrencesOfString:@"&quot" withString:@"\""];
    html = [html stringByReplacingOccurrencesOfString:@"&hellip" withString:@"..."];
    html = [html stringByReplacingOccurrencesOfString:@"&rdquo" withString:@"”"];
    html = [html stringByReplacingOccurrencesOfString:@"&lsquo" withString:@"‘"];
    html = [html stringByReplacingOccurrencesOfString:@"&rsquo" withString:@"’"];
    html = [html stringByReplacingOccurrencesOfString:@"&ldquo" withString:@"“"];
    html = [html stringByReplacingOccurrencesOfString:@"&darr" withString:@"↓"];
    html = [html stringByReplacingOccurrencesOfString:@"&middot" withString:@"·"];
上一篇下一篇

猜你喜欢

热点阅读