我有一个小问题,我正在使用一个代码片段从 iOS 字符串中删除 html 代码:
while ((r = [s rangeOfString:@"<[^>]+>" options:NSRegularExpressionSearch]).location != NSNotFound)
s = [s stringByReplacingCharactersInRange:r withString:@""];
现在我需要删除一些块,比如 . 为什么此代码段不起作用:
while ((r = [s rangeOfString:@"<style[^>]+style>" options:NSRegularExpressionSearch]).location != NSNotFound)
s = [s stringByReplacingCharactersInRange:r withString:@""];
感谢帮助!