Skip to content

Commit e219a0b

Browse files
authored
Document Unicode encoding behavior in Uri.GetLeftPart method (#11479)
1 parent 6a1b0a7 commit e219a0b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

xml/System/Uri.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2442,6 +2442,12 @@ If you used an escaped string to construct this instance (for example, `"http://
24422442
24432443
The <xref:System.Uri.GetLeftPart%2A> method returns a string containing the leftmost portion of the URI string, ending with the portion specified by `part`.
24442444
2445+
> [!IMPORTANT]
2446+
> The <xref:System.Uri.GetLeftPart%2A> method performs Unicode character encoding and normalization as part of its processing. It is not a simple string manipulation method. The returned string may differ from the original URI string due to this encoding behavior.
2447+
2448+
The <xref:System.Uri.GetLeftPart%2A> method is equivalent to calling <xref:System.Uri.GetComponents%2A> with the appropriate <xref:System.UriComponents> flags. For example:
2449+
- `GetLeftPart(UriPartial.Authority)` is equivalent to `GetComponents(UriComponents.Scheme | UriComponents.UserInfo | UriComponents.Host | UriComponents.Port, UriFormat.UriEscaped)`
2450+
24452451
<xref:System.Uri.GetLeftPart%2A> includes delimiters in the following cases:
24462452
24472453
- <xref:System.UriPartial.Scheme> includes the scheme delimiter.

0 commit comments

Comments
 (0)