Your browser (Internet Explorer 6) is out of date. It has known security flaws and may not display all features of this and other websites. Learn how to update your browser.
X

NSString – Decode and encode HTML character entities

  • Facebook
  • Twitter
  • Google Plus
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

First you have to download the “NSString+HTML” class.

download: github

USAGE
.m File

#import "NSString+HTML.h"

- (void)viewDidLoad
{
    [super viewDidLoad];

     NSString *r = @"This is a '\'";
     NSString *s = @"This is a &ltHTML-Tag&gt";

     NSString *encodedstring =  [r kv_encodeHTMLCharacterEntities];

     NSString *decodedstring =  [s kv_decodeHTMLCharacterEntities];

}


0
  
  • Thanks for sahring. Always good to find a real expert.

    Raynes

    12. August 2012

Leave a comment  

name*

email*

website

Submit comment