I have a type with a string property called 'TestValue' that contains a string that includes characters that are escape sequences for c#. e.g. "blah\"". I need these characters to print out to the console as well.
Console.WriteLine(obj.TestValue); // prints only blah"
When I hover over that variable in the debugger I can see the exact string "blah\"", but when printed out to the console, only blah" shows up, I want blah\" to show up.
How can I get this to work?
Choose one: @"blah\""" or "blah\\\""
@ denotes a verbatim string, but you still need to escape a double quote by doubling it up. Or you can simply escape the \ by doubling it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With