开发者

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

This question already has answers here: How can I decode HTML characters in C#? (10 answers) 开发者_JS百科 Closed 7 years ago.

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#?


That is HTML encoded, so:

HttpUtility.HtmlDecode(myHtmlEncodedString);

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


HttpUtility.HtmlDecode(string)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜