stripHtml method to all NSStrings. To use this include the .h and .m file into your project and:Import the header:
#import "NSString_stripHtml.h"And then call stripHtml:
NSString* mystring = @"<b>Hello</b> World!!";
NSString* stripped = [mystring stripHtml];
// stripped will be = Hello World!!
nice method. i'd like to replace break tags <-br-> (hyphens added to prevent rendering here) with a space rather than no space. but i'm not sure where to put the if logic for this exclusion. thanks for your help!
ReplyDeleteHow can i download the files?
ReplyDeleteYou can see the files now. There was a problem with the blog page and the github files weren't displaying.
ReplyDeleteIt's great ... thanks
ReplyDeleteThis worked better in my project than feeding the string through the NSAttributedString initWithHTM method. It produces a lot fewer empty lines. It is also a lot easier than playing around with the three20 framework. Thanks for your post.
ReplyDelete