I have a string in a watch window in VS2008 and want to see the hex representation of each character. If I right click there's a hexadecimal option but this doesn't appear to do anything. Anybody know how to view the string as a series of hex values?
+1
A:
Default visualizer in VS (at least 2005) does not support this. However, apparently it isn't too much trouble to roll one's own visualizer: http://msdn.microsoft.com/en-us/library/ms379596.aspx (That's an old article from 2005 beta times, but I don't think the API changed much.)
Perhaps somebody somewhere even wrote one, but I haven't seen one yet.
Ishmaeel
2008-10-08 23:02:40
+2
A:
Add your string as a watch, then edit the watch expression and append ".ToCharArray()" to view it as an array of chars. When you expand your watch you will see char code next to each individual char. Checking "Hexadecimal display" will show you hex codes for each character.
Marko Dumic
2008-10-08 23:10:41