【问题标题】:How to remove the Tags from the strings in iPhone?如何从 iPhone 中的字符串中删除标签?
【发布时间】:2010-12-29 11:30:04
【问题描述】:

我想从我的字符串中删除标签。

例如,

     NSSTring *str = @"<null>";

     My expected output is null. 

所以我想删除 HTML 标签。

所以请指导我。

谢谢。

         .

【问题讨论】:

    标签: iphone objective-c ios tags nsstring


    【解决方案1】:

    试试,

    str = [str stringByReplacingOccurrencesOfString:@"<" withString:@""];
    str = [str stringByReplacingOccurrencesOfString:@">" withString:@""];
    

    【讨论】:

      【解决方案2】:

      如果要删除“”符号,可以使用以下代码。

      string = [string stringByReplacingOccurrencesOfString:@"<" withString:@""];
      string = [string stringByReplacingOccurrencesOfString:@">" withString:@""];
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-03-21
        • 2013-08-30
        • 2015-03-24
        • 2014-01-07
        • 1970-01-01
        相关资源
        最近更新 更多