IOS过滤Html标签
来源:互联网 发布:帕克生涯数据 编辑:程序博客网 时间:2024/06/05 09:02
- (NSString *)flattenHTML:(NSString *)html trimWhiteSpace:(BOOL)trim { NSScanner *theScanner = [NSScanner scannerWithString:html]; NSString *text = nil; while ([theScanner isAtEnd] == NO) { // find start of tag [theScanner scanUpToString:@"<" intoString:NULL] ; // find end of tag [theScanner scanUpToString:@">" intoString:&text] ; // replace the found tag with a space //(you can filter multi-spaces out later if you wish) html = [html stringByReplacingOccurrencesOfString: [ NSString stringWithFormat:@"%@>", text] withString:@""]; //NSLog(@"html==%@",html); } html = [html stringByReplacingOccurrencesOfString:@" " withString:@""]; // trim off whitespace return trim ? [html stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] : html;}
0 0
- IOS过滤Html标签
- iOS 过滤html标签
- IOS中过滤HTML标签
- IOS中过滤HTML标签
- iOS开发 字符串过滤html标签
- iOS NSString如何过滤html标签
- ASP 过滤 HTML 标签
- .net 过滤html标签
- html标签过滤
- 过滤 HTML 标签例子
- php 过滤 html标签
- 过滤html标签
- 过滤HTML标签
- HTML标签过滤方案
- 过滤 html标签
- Java过滤HTML标签
- 过滤html标签
- js过滤HTML标签
- Android Fragment 笔记
- A Linux serial port test program
- 结构体用于map,set时要重载运算符<
- Android-Universal-Image-Loader图片加载框架使用
- ubutun搭建LAMP环境步骤
- IOS过滤Html标签
- LINUX获取前一天日期的方法
- 如何在Root的手机上开启ViewServer,使得HierachyViewer能够连接
- leetcode 日经贴,Cpp code -Median of Two Sorted Arrays
- 可以运行测试的IOS同步请求、异步请求、GET请求、POST请求
- Mybatis无需更改原有代码1分钟完美实现分页功能插件(不服你咬我)
- 漫谈IA32的系统管理模式(SMM)以及IA32的四种CPU模式
- linux 重定向命令
- java cookie