3

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.

Sheik_101
  • 770
  • 1
  • 8
  • 24

1 Answers1

0

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...!

Vidhyanand
  • 5,369
  • 4
  • 26
  • 59
  • Thank you for your answer. I tried this. It is only removing unordered bullets. I want both ordered and unordered bullets to be removed. – Sheik_101 Apr 13 '15 at 06:33
  • Try with different bullet codes as shown in this link..http://sourceforge.net/p/docutils/mailman/message/9699987/ U can find other codes for bullets from this link...! – Vidhyanand Apr 13 '15 at 06:52
  • You can print the output using NSLog and find the uni code for Ordered List bullet and use that code to trim..from your strings...! – Vidhyanand Apr 13 '15 at 06:59