iosobjective-cnsstringnsattributedstringbullet-span

How to find bullets or numbered bullets is present in NSString using NSRegularExpressionSearch?


I have a NSString which may have ordered bullets or unordered bullets as a string. I want to remove that bullets alone from the string.

Can someone please help me out in this?. Thanks in advance.


Solution

  • You can trim bullets using below code. I am not using Regular Expression. I am giving idea how to identify and remove bullets..

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

    Hope it helps you...!