【问题标题】:How to remove HTML tags in iOS?如何在 iOS 中删除 HTML 标签?
【发布时间】:2016-02-02 14:12:35
【问题描述】:

从我的.plist 我得到一个这样的字符串:

some string + <span class="ppCodeTab">  </span><span class="ppCodeTab"> </span>

我用这个方法:

stringByReplacingOccurrencesOfString:@"<span class=``ppCodeTab``>   </span><span class=``ppCodeTab``>   </span>" withString:@""];

替换 span 的东西,但它不起作用。

【问题讨论】:

标签: html ios


【解决方案1】:

您可以简单地Split 字符串。

var strings = split(infoString) {$0 == "<span"}

字符串[0] 将是“一些字符串” 你可以忽略其余的。

【讨论】:

    猜你喜欢
    • 2013-12-16
    • 1970-01-01
    • 2012-06-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-14
    相关资源
    最近更新 更多