سؤال

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

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

نصائح أخرى

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

In .NET 4

 System.Net.WebUtility.HtmlDecode(mystr)
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top