简体   繁体   English

如何从C#中的字符串中删除\\ u000a

[英]How to remove \u000a from a string in C#

I have a String config which is something like 我有一个字符串配置,就像

<config schemaVersion="2.0" version="63634948757">
\u000a<settings>\u000a        <currentValue>\u000a    

I want to remove the line return character \ . 我要删除行返回字符\\ u000a。 I tried 我试过了

config = config.Replace("\u000a", "");

But it doesn't work. 但这是行不通的。 Would appreciate it if someone could help. 如果有人可以帮助,将不胜感激。

you need to escape \\ , use double \\\\ 您需要转义\\ ,使用双\\\\

config = config.Replace("\\\ ", "");

OR 要么

config = config.Replace(@"\ ", "");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM