【问题标题】:How to find bullets or numbered bullets is present in NSString using NSRegularExpressionSearch?如何使用 NSRegularExpressionSearch 在 NSString 中查找项目符号或编号项目符号?
【发布时间】:2015-04-13 06:18:47
【问题描述】:

我有一个NSString,它可能有ordered bulletsunordered bullets 作为字符串。我想从字符串中单独删除那些子弹。

有人可以帮我解决这个问题吗? 提前致谢。

【问题讨论】:

    标签: ios objective-c nsstring nsattributedstring bullet-span


    【解决方案1】:

    您可以使用以下代码修剪项目符号。我没有使用正则表达式。我正在给出如何识别和删除子弹的想法..

    NSString *bulletString = @"\u2022";
    self.lbl.text=[strWithBullets stringByReplacingOccurrencesOfString:bulletString withString:@""];
    

    希望对您有所帮助...!

    【讨论】:

    • 感谢您的回答。我试过这个。它只是删除无序的子弹。我希望删除有序和无序的项目符号。
    • 尝试使用不同的项目符号代码,如此链接所示..sourceforge.net/p/docutils/mailman/message/9699987您可以从此链接找到其他项目符号代码...!
    • 您可以使用 NSLog 打印输出并找到有序列表项目符号的 uni 代码,并使用该代码从您的字符串中修剪...!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多