I have a string called argument that I need to send to a process. My argument was built and when I check the value from the immediate window I get this:
argument
" -i \"M:\\visual studio 2013\\cherry\\Database\\script.sql\" -v varDb=foobar"
what I want is to have this: (replace \ with \ and replace \" with ")
argument
" -i "M:\visual studio 2013\cherry\Database\script.sql" -v varDb=foobar"
I'm somewhat embarrassed I have to ask this, but I've tried all sorts of .Replace and regex expressions already.
As has been mentioned by others, the immediate window shows the unescaped string (by default). This can be changed using format specifiers (MSDN).
Appending ,nq
should remove escape chars
See: Copy value of watch variable in visual studio without escape characters for an example
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