4

Is there a way to get Visual Studio to display strings as verbatim strings (prefixed with '@')? I'd like to easily cut strings containing file paths from Visual Studio into Explorer or other apps.

Clarification: when VS displays a string in the auto, watch, immediate, etc. window, I'd like it to be formatted as as verbatim string so that I can simple copy it for use elsewhere.

Keith
  • 543
  • 3
  • 8

3 Answers3

7

You can click on the magnifier in VS 2008 debugger variable display and select "Text Visualizer" which will give you the text in an unmassaged format.

plinth
  • 48,267
  • 11
  • 78
  • 120
0

You may need to clarify your question. My first thought was that you just need to prefix the string with '@' to make them verbatim, but you already know that.

string s = @"c:\my folder\";

What exactly are you trying to do with the string?

a_hardin
  • 4,991
  • 4
  • 32
  • 40
0

Here's a discussion on how to actually build verbatim-ized strings: Can I convert a C# string value to a string literal.

Plugging this in a debug vizualiser is a different story...

Community
  • 1
  • 1
Cristian Diaconescu
  • 34,633
  • 32
  • 143
  • 233