What are invalid characters in XML

后端 未结 15 1737
时光说笑
时光说笑 2020-11-22 03:23

I am working with some XML that holds strings like:

This is a string

Some of the strings that I am passing to the

15条回答
  •  说谎
    说谎 (楼主)
    2020-11-22 04:06

    "XmlWriter and lower ASCII characters" worked for me

    string code = Regex.Replace(item.Code, @"[\u0000-\u0008,\u000B,\u000C,\u000E-\u001F]", "");
    

提交回复
热议问题