开发者

Extracting content from the string which has html tag in it in objective-c

开发者 https://www.devze.com 2022-12-18 04:53 出处:网络
I am new to iphone development.I am having a string which has HTML tags in its content.I want to filter thetag and save the content in another string.

I am new to iphone development.I am having a string which has HTML tags in its content.I want to filter the tag and save the content in another string.

Ex:

NSString *HTMLData = @"<h1>Hello this is a test</h1>";

I want to filter the header tag and set the content to another string like

NSString *actualData=@"hello this is a test" or any string which contain the actual dat开发者_如何学Goa without HTML tags.

Please help me out.Thanks.


Better Solution:

http://rudis.net/content/2009/01/21/flatten-html-content-ie-strip-tags-cocoaobjective-c

Works For me


http://sugarmaplesoftware.com/25/strip-html-tags/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号