Skip to content
Permalink
Browse files

Corrected length of result string with 'X' (#12454)

* Corrected length of result string with 'X'

* Update enumeration-format-strings.md

* Update enumeration-format-strings.md
  • Loading branch information...
rpetrusha committed May 22, 2019
1 parent 8bd6290 commit 21a8564b1630e94a017b654e4484143865c56378
Showing with 1 addition and 1 deletion.
  1. +1 −1 docs/standard/base-types/enumeration-format-strings.md
@@ -42,7 +42,7 @@ Displays the enumeration entry as an integer value in the shortest representatio

## X or x

Displays the enumeration entry as a hexadecimal value. The value is represented with leading zeros as necessary, to ensure that the value is a minimum eight digits in length. The following example illustrates the X format specifier.
Displays the enumeration entry as a hexadecimal value. The value is represented with leading zeros as necessary, to ensure that the result string has two characters for each byte in the enumeration type's [underlying numeric type](xref:System.Enum.GetUnderlyingType%2A). The following example illustrates the X format specifier. In the example, the underlying type of both <xref:System.ConsoleColor> and <xref:System.IO.FileAttributes> is <xref:System.Int32>, or a 32-bit (or 4-byte) integer, which produces an 8-character result string.

[!code-csharp[Formatting.Enum#4](~/samples/snippets/csharp/VS_Snippets_CLR/Formatting.Enum/cs/enum1.cs#4)]
[!code-vb[Formatting.Enum#4](~/samples/snippets/visualbasic/VS_Snippets_CLR/Formatting.Enum/vb/enum1.vb#4)]

0 comments on commit 21a8564

Please sign in to comment.
You can’t perform that action at this time.