Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert HTML codes to plain text

I've a string for example like this:

Col´gio

How can I convert it to:

Colégio

Without having to do a replace for all the html codes

like image 583
Bruno Cruz Avatar asked May 24 '12 10:05

Bruno Cruz


People also ask

How do I convert to plaintext?

1. Open TextEdit and then open the document in TextEdit by clicking on Open in the File menu. 2. Click on Format, then Make Plain Text.

How do I convert HTML to plain text in Excel?

Remove HTML from Text in ExcelSelect the cell that contains the HTML and hit Ctrl + H to go to the Find/Replace window. In the Find what: input, type <*> and then leave the Replace with: input blank.


2 Answers

Just for completion:

If you are using .NET 4.0+ you can also use WebUtility.HtmlDecode

like image 72
julianox Avatar answered Sep 28 '22 03:09

julianox


System.Web.HttpUtility.HtmlDecode("Col&acute;gio");
like image 22
L.B Avatar answered Sep 28 '22 03:09

L.B