简体   繁体   中英

How to display HTML_TEXT as Plain_text in Windows Phone 8?

In my application, I am displaying RSS_FEEDS in ListView which contains two Textblocks, one for title and other for description. But in case of description, I am getting Html_text and it is getting displayed as it is. Please suggest how to remove the tags. I have tried using Regular Expressions but it removes tags,but it doesn't remove nbsp ,
tags.Also please suggest if there is
tag then I want to show that in new line. Please find my code below:

private string getplain_text(string p)
    {
        string plain_text = string.Empty;
        plain_text = Regex.Replace(p, "\\<[^\\>]*\\>", string.Empty);
        return plain_text;
    }

Awaiting for good responses.

Thanks

HTML Agility pack library is good for html document manipulation. You can create document using your html content and plain text getting methods are available there

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM