Skip to content

Commit c2aad4a

Browse files
gbad8gewarrenCopilot
authored
Fix example on Composit format string (#49284)
* Fixing examples on Composit format string The example on (Composite format string)[https://learn.microsoft.com/en-us/dotnet/standard/base-types/composite-formatting#composite-format-string] was reffering to a object called name. However, the String.Format method was using simply a string. * Update docs/standard/base-types/composite-formatting.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 430e478 commit c2aad4a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/standard/base-types/composite-formatting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Consider the following <xref:System.String.Format%2A> code fragment:
4242
:::code language="vb" source="./snippets/composite-formatting/net/vb/Program.vb" id="basic":::
4343

4444
<!-- markdownlint-disable-next-line no-space-in-code -->
45-
The fixed text is `Name = `&nbsp;and `, hours = `. The format items are `{0}`, whose index of 0 corresponds to the object `name`, and `{1:hh}`, whose index of 1 corresponds to the object `DateTime.Now`.
45+
The fixed text is `Name = `&nbsp;and `, hours = `. The format items are `{0}`, whose index of 0 corresponds to the string literal `"Fred"`, and `{1:hh}`, whose index of 1 corresponds to the value of `DateTime.Now`.
4646

4747
## Format item syntax
4848

0 commit comments

Comments
 (0)