简体   繁体   English

停止 Visual Studio 调试在包含双引号的字符串中放置斜杠

[英]Stop visual studio debug putting slash in string containing double quotes

I hit this odd behavour yesterday in Visual Studio 2015 where I was making a string that started and ended with double quotes.我昨天在 Visual Studio 2015 中遇到了这种奇怪的行为,我正在制作一个以双引号开头和结尾的字符串。 In stepping through the code I hovered over the result to see the contents and there were back slashes in the string - what!在逐步执行代码时,我将鼠标悬停在结果上以查看内容,并且字符串中有反斜杠 - 什么! (see image below). (见下图)。 Cutting a long story short, I figured out the debug view of the variable is displaying with the escaping backslashes - which in my opinion is misleading.长话短说,我发现变量的调试视图显示带有转义的反斜杠 - 在我看来这是误导。

Does any one know if there is a way to disable this in Visual Studio so that it just displays the value as either ""bob*"" or without indication of the string type "bob*" ?有谁知道是否有办法在 Visual Studio 中禁用它,以便它只将值显示为""bob*""或不指示字符串类型"bob*"

在此处输入图片说明

PS Yes I know, it seems a bit newbie to be using VS for years before noticing this behavour. PS 是的,我知道,在注意到这种行为之前使用 VS 多年似乎有点新手。 Also the image is not showing our production code :)图像也没有显示我们的生产代码:)

This is expected.这是预期的。 Because you are under debug mode you are given the dev version of the string.因为您处于调试模式,所以您将获得字符串的开发版本。

To get a user friendly version of the string (actual value without slash) you just have to click on the magnify glass icon on the left要获得字符串的用户友好版本(不带斜杠的实际值),您只需单击左侧的放大镜图标

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 停止visual studio将.DLL文件放入/ debug - Stop visual studio putting .DLL files in /debug 使用包含双引号的字符串属性序列化对象 - Serializing an object with a string property containing double quotes 如何插入包含单引号或双引号的字符串 - How to insert string containing single or double quotes Visual Studio 2008调试不会因错误而停止 - Visual Studio 2008 debug does not stop on error 如何在前景中使用C#来执行带有反斜杠,双引号的参数的命令? - How to execute command with parameters containing back slash, double quotes with help of C# in foreground? 阻止 Visual Studio 将 using 指令置于命名空间之外 - Stop Visual Studio from putting using directives outside namespace 如何表达包含双引号而没有转义字符的字符串文字? - How to express a string literal containing double quotes without escape characters? 将包含日期和时间的字符串替换为以 =(等号)为前缀的双引号 - Replacing the String containing Date and Time with Double Quotes prefixed with =(Equal Sign) 如何将包含双引号的字符串作为参数传递到BAT文件 - How to pass a string containing double quotes to a BAT file as an argument 字符串中的双引号 - Double double quotes in the string
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM