Skip to content

Commit 71024a8

Browse files
Fix typo in ICustomFormatter doc (#8910)
1 parent dd0b1f3 commit 71024a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xml/System/ICustomFormatter.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
6969
7070
## Examples
71-
The following example implements <xref:System.ICustomFormatter> to allow binary, octal, and hexadecimal formatting of integral values. In this example, a single class, `IBinaryFormatter`, implements both <xref:System.ICustomFormatter> and <xref:System.IFormatProvider>. Its <xref:System.IFormatProvider.GetFormat%2A?displayProperty=nameWithType> method determines whether the `formatType` parameter represents an <xref:System.ICustomFormatter> type. If it does, `BinaryFormatter` returns an instance of itself; otherwise, it returns `null`. Its <xref:System.ICustomFormatter.Format%2A?displayProperty=nameWithType> implementation determines whether the format parameter is one of the three supported format strings ("B" for binary, "O" for octal, and "H" for hexadecimal) and formats the `arg` parameter appropriately. Otherwise, if `arg` is not `null`, it calls the `arg` parameter's <xref:System.IFormattable.ToString%2A?displayProperty=nameWithType> implementation, if one exists, or its parameterless `ToString` method, if one does not. If `arg` is `null`, the method returns <xref:System.String.Empty?displayProperty=nameWithType>.
71+
The following example implements <xref:System.ICustomFormatter> to allow binary, octal, and hexadecimal formatting of integral values. In this example, a single class, `BinaryFormatter`, implements both <xref:System.ICustomFormatter> and <xref:System.IFormatProvider>. Its <xref:System.IFormatProvider.GetFormat%2A?displayProperty=nameWithType> method determines whether the `formatType` parameter represents an <xref:System.ICustomFormatter> type. If it does, `BinaryFormatter` returns an instance of itself; otherwise, it returns `null`. Its <xref:System.ICustomFormatter.Format%2A?displayProperty=nameWithType> implementation determines whether the format parameter is one of the three supported format strings ("B" for binary, "O" for octal, and "H" for hexadecimal) and formats the `arg` parameter appropriately. Otherwise, if `arg` is not `null`, it calls the `arg` parameter's <xref:System.IFormattable.ToString%2A?displayProperty=nameWithType> implementation, if one exists, or its parameterless `ToString` method, if one does not. If `arg` is `null`, the method returns <xref:System.String.Empty?displayProperty=nameWithType>.
7272
7373
:::code language="csharp" source="~/snippets/csharp/System/ICustomFormatter/Overview/binaryformatter.cs" id="Snippet1":::
7474
:::code language="fsharp" source="~/snippets/fsharp/System/ICustomFormatter/Overview/binaryformatter.fs" id="Snippet1":::

0 commit comments

Comments
 (0)