我有一个包含XML描述的字符串(来自CDATA元素)。我需要把这个字符串解码成显示正确使用C#如何将字符串解码为C#中的XML字符串
现有的字符串中的字符一个新的字符串:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><myreport xmlns="http://test.com/rules/client"><admin><ordernumber>123</ordernumber><state>NY</state></report></myreport>
字符串通缉:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<myreport xmlns="http://test.com/rules/client">
<admin><ordernumber>123</ordernumber><state>NY</state></report></myreport>
但你现有的字符串*无效* – naveen
@naveen:当然,这只是字符串的_contents_ ... –
@Jeff Mercado:当我看到字符串无效并且HtmlDecode赢得了使用linqpad写回答因为它接受'字符串'而不工作。很显然,我们的OP也需要转义'“' – naveen