Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. 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*" ?

enter image description here

P.S. Yes I know, it seems a bit newbie to be using VS for years before noticing this behavour. Also the image is not showing our production code :)

like image 543
miltonb Avatar asked Dec 15 '16 20:12

miltonb


Video Answer


1 Answers

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

like image 111
Steve Avatar answered Sep 19 '22 23:09

Steve