简体   繁体   中英

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 \ . 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(@"\ ", "");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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