[英]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.