XML Deserialization of string elements with newlines in C#

后端 未结 3 466
迷失自我
迷失自我 2021-02-06 08:42

I can\'t seem to figure out why this test doesn\'t pass

The test is:

given the following XML:


           


        
3条回答
  •  粉色の甜心
    2021-02-06 09:16

    You can create custom XmlTextReader class:

    public class CustomXmlTextReader : XmlTextReader
    {
        public CustomXmlTextReader(Stream stream) : base(stream) { }
    
        public override string ReadString()
        {
            return base.ReadString().Trim();
        }
    }
    

提交回复
热议问题