Reputation: 673
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.
Upvotes: 4
Views: 804
Reputation: 35681
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...
Upvotes: 0
Reputation: 49199
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.
Upvotes: 7
Reputation: 5260
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?
Upvotes: 0