ios html 转义字符串,ioS html的转义
生活随笔
收集整理的這篇文章主要介紹了
ios html 转义字符串,ioS html的转义
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
標簽:iosNSString?*htmlString?=?@"快樂每一天,還剩365天";
NSAttributedString?*attributedString?=?[[NSAttributedString?alloc]?initWithData:[htmlString?dataUsingEncoding:NSUTF8StringEncoding]?options:@{NSDocumentTypeDocumentAttribute:NSHTMLTextDocumentType,NSCharacterEncodingDocumentAttribute:@(NSUTF8StringEncoding)}?documentAttributes:nil?error:nil];
遇到html字符串的話,需要展示的話,有時候需要轉義,用上面的方法可以展示,如果格式不是標準的格式不行,必須轉化成標準的格式才能顯示,
標簽:ios
原文:http://smengxiang.blog.51cto.com/11204872/1871972
總結
以上是生活随笔為你收集整理的ios html 转义字符串,ioS html的转义的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: HTML阅读位置,script在HTML
- 下一篇: html怎么防止表单重复提交,js防止表