views:

94

answers:

2

Ok, this one has been driving me bonkers for ages and VS 2010 hasn't improved this. Say I have a variable like so

string szSql = 
@"SELECT 
     Foo, Bar
FROM
     Table
WHERE
     Foo = Bar";

If I'm inspecting this in the debugger and choose "Copy Value" the value put into the clipboard has \r\n's in place of the carriage returns which is a bit of a pain. Is there a way to change this behaviour? (I know I can print it in the command window...)

Cheers,

Alex

+1  A: 

Use the "text visualizer" popup on the value and copy it to the clipboard from there. It will be unescaped.

jlew
Hmm, not ideal, still an extra couple of clicks to get it in the clipboard.Thanks though!!!!
Alex DeLarge
A: 

For lengthy text, such as a large xml document, I always use the immediate window. Just type this in and hit enter:

System.Diagnostics.Debug.WriteLine(szSql)

and it will spit out the text with line breaks and without escape characters. I then copy from the immediate window.

Mike Ohlsen
Or you could just type ? szSql - as I said I knew this but it's a lot of extra keypresses.
Alex DeLarge