How can i convert an html encoded string to a normal string?

466 views Asked by At

how can i convert an html-encoded string like the one below to a normal string? (it's Hello World)

mystr="Hello World";

i am using Windows phone sdk.

3

There are 3 answers

0
BRAHIM Kamel On BEST ANSWER

here another way to do it

 string  mystr = "Hello World";
        var arr = mystr.Split(';');
        string newMStr = string.Empty; 
        foreach (var s in arr)
        {
            string newS= s.Remove(0, 2);
           newMStr+= Convert.ToChar(int.Parse(newS));
        }

         //Print  NewMstr
0
S Farron On

In .NET 4

 System.Net.WebUtility.HtmlDecode(mystr)
0
a-ctor On

HtmlDecode in System.Net

Just give it the string you want to convert

http://msdn.microsoft.com/de-de/library/7c5fyk1k%28v=vs.110%29.aspx