I have a WPF app, which is capturing some text as follows:
<TextBox x:Name="MyText" Text="\n,\r"/>
I then pass this to a function which is checking for the presence of these characters in a string:
MyFunc(MyText.Text);
But the characters are being escaped; so MyText.Text looks like this:
"\\n,\\r"
How can I prevent the string from being escaped (if it were a literal, I could simply use the @
character, but this is entered by the user)?