5

How to convert the following text into a proper string in C#?

<IconStyle xmlns="http://earth.google.com/kml/2.0"><color>FFFFFFFF</color><scale>1.0</scale><Icon><href>root://icons/palette-5.png</href><x>192</x><y>192</y><w>32</w><h>32</h></Icon></IconStyle><LabelStyle xmlns="http://earth.google.com/kml/2.0"><scale>0</scale></LabelStyle><BalloonStyle xmlns="http://earth.google.com/kml/2.0"><text>$[description]</text><color>FFFFFFFF</color></BalloonStyle>

Forgot to mention the important catch:how to convert the string in a console application in c#?

Carsen
  • 183
  • 1
  • 2
  • 9

2 Answers2

17

That is HTML encoded, so:

HttpUtility.HtmlDecode(myHtmlEncodedString);

Reference: http://msdn.microsoft.com/en-us/library/7c5fyk1k.aspx

BFil
  • 12,966
  • 3
  • 44
  • 48
1
HttpUtility.HtmlDecode(string)
Lloyd Powell
  • 18,270
  • 17
  • 87
  • 123
MadBender
  • 1,438
  • 12
  • 15