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
  • 383
  • 2
  • 6

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
  • 47,047
  • 11
  • 77
  • 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,806
  • 4
  • 30
  • 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
  • 33,323
  • 31
  • 136
  • 227