我有一個包含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