ios - how to change HTML value in UITextView -
i have description option in database , convert json
format. after fetching database i'm displaying uitextview
. it's showing below values.
<p>table : 1</p><p>table : 2</p><div><p>table : 3</p><div><p>table : 4</p><div><p>table : 5</p><div><p>table : 6</p><p>table : 7</p><p>table : 8</p><div> </div></div></div></div></div>
html decode:
nsstring *decodestring = [self htmlentitydecode:productdescription]; txtt.text = decodestring;
remove html tag html string
-(nsstring *) stringbystrippinghtml { nsrange r; nsstring *s = [[self copy] autorelease]; while ((r = [s rangeofstring:@"<[^>]+>" options:nsregularexpressionsearch]).location != nsnotfound) s = [s stringbyreplacingcharactersinrange:r withstring:@""]; return s; }
Comments
Post a Comment