I wish this helpful for you There are some characters which are special and need to be escaped. Like when you define a string
str = " this is test string \
and this contains multiline data \
do you understand the backslash meaning here \
it is being used to denote the continuation of line"
char = "\\"
char.length # => 1
How can I match and remove the backslash "\" and "\n" character using the .NET Regex Library?
By : Abel Belzunces Burgu
Date : March 29 2020, 07:55 AM
it fixes the issue The question still isn't clear: if you write the XML string (before you try to clean it) to the console, do you see exactly what you posted above, with all those \" and \n sequences? Does the displayed string start and end with a quotation mark? If so, you probably want to remove the opening and closing quotation marks and all the backslashes, and if any backslash is followed by an 'n', you want to remove that as well. Here's some code to demonstrate: