Compiled Chronicles

A software development blog by Angelo Villegas

iOS: NSString+HTMLHelper

NSString+HTMLHelper is a collection of methods that helps me deal with HTML tags and URLs.

NSString+HTMLHelper Download Link

Sample Usage:

Please look at the demo project. It has sample codes on how to use the category.


// Class Methods
+ (NSString *)mimeTypeFromURL:(NSURL *)pathForResource;
+ (NSString *)mimeTypeFromResource:(NSString *)pathForResource ofType:(NSString *)type;

// Instance Methods
- (NSString *)URLEncodeString;
- (NSString *)URLDecodeString;
- (NSString *)replaceTagWithLineBreak;
- (NSString *)replaceTagWithWhiteSpace;
- (NSString *)stripHTMLTags;


Just copy the NSString+HTMLHelper Category or NSString+HTMLHelper.h and NSString+HTMLHelper.m files to your project and #import the header file NSString+HTMLHelper.h


Leave a Reply

Your email address will not be published. Required fields are marked *