Format Specifiers in C#
This topic applies to:
Pro, Premium, and Ultimate
When you debug C# code in the Watch window or QuickWatch dialog box, you change the format in which a value is displayed using format specifiers.
To use a format specifier, type the expression followed by a comma. After the comma, add the appropriate specifier.
Suppose nVar is a character variable, and the Watch window shows the value as 0x0000F065. You want to see this value as decimal, but you do not want to reset the display of all variables to decimal. You can use the format specifier d to show the variable contents in decimal:
The following table shows the C# format specifiers recognized by the debugger.
Force evaluation of an expression. This can be useful when implicit evaluation of properties and implicit function calls is turned off. See Side Effects and Expressions.
Displays the specified object using a Dynamic View
String with No Quotes
Displays all public and non-public members
Displays item as it appears in the raw item node. Valid on proxy objects only.
Used with a variable of a type that implements IEnumerable or IEnumerable<T>, usually the result of a query expression. Displays only the members that contain the query result.