我有一个带有回车符的XML元素:
<expectedValue>Success: Your Payment information has been updated!</expectedValue>
我曾期望将其反序列化为具有字符串属性的对象时,它们将显示为C#转义字符,例如:
Success:\r\nYour Payment information has been updated!
但是该字符串仍然带有文字实体值:
Success: Your Payment information has been updated!
有没有办法像我期望的那样对它进行反序列化?
看看SecurityElement.Escape,您会看到所有已编码/已解码的字母。如果您进一步非xml编码xml中的数据,则必须对其进行相应解码。