Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
typo "EncodeToUtf8" > "TryEncodeToUtf8"
  • Loading branch information
ctstacey authored Dec 4, 2022
commit 594c1a55024ae1a5fdc20180153dabbad9eacf13
2 changes: 1 addition & 1 deletion xml/System.Text/Rune.xml
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ The following example converts a `Rune` instance to a `UTF-8` byte array:

:::code language="csharp" source="~/snippets/csharp/System.Text/Rune/Overview/EncodeRune.cs" id="SnippetUtf8ByteArray":::

The <xref:System.Text.Rune.EncodeToUtf16%2A?displayProperty=nameWithType> and <xref:System.Text.Rune.EncodeToUtf8%2A?displayProperty=nameWithType> methods return the actual number of elements written. They throw an exception if the destination buffer is too short to contain the result. There are non-throwing <xref:System.Text.Rune.TryEncodeToUtf8%2A> and <xref:System.Text.Rune.EncodeToUtf16%2A> methods as well for callers who want to avoid exceptions.
The <xref:System.Text.Rune.EncodeToUtf16%2A?displayProperty=nameWithType> and <xref:System.Text.Rune.EncodeToUtf8%2A?displayProperty=nameWithType> methods return the actual number of elements written. They throw an exception if the destination buffer is too short to contain the result. There are non-throwing <xref:System.Text.Rune.TryEncodeToUtf8%2A> and <xref:System.Text.Rune.TryEncodeToUtf16%2A> methods as well for callers who want to avoid exceptions.

### Rune in .NET vs. other languages

Expand Down