Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix remarks of String.ReplaceLineEndings #7908

Merged
merged 1 commit into from
Apr 4, 2022
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
38 changes: 10 additions & 28 deletions xml/System/String.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11762,24 +11762,15 @@ Because this method returns the modified string, you can chain together successi

## Remarks

This method searches for all newline sequences within the string and canonicalizes them to match
the newline sequence for the current environment. For example, when running on Windows, all
occurrences of non-Windows newline sequences will be replaced with the sequence CRLF. When
running on Unix, all occurrences of non-Unix newline sequences will be replaced with
a single LF character.
This method searches for all newline sequences within the string and canonicalizes them to match the newline sequence for the current environment. For example, when running on Windows, all occurrences of non-Windows newline sequences will be replaced with the sequence CRLF. When running on Unix, all occurrences of non-Unix newline sequences will be replaced with a single LF character.

It is not recommended that protocol parsers utilize this API. Protocol specifications often
mandate specific newline sequences. For example, HTTP/1.1 (RFC 8615) mandates that the request
line, status line, and headers lines end with CRLF. Since this API operates over a wide range
of newline sequences, a protocol parser utilizing this API could exhibit behaviors unintended
by the protocol's authors.
It is not recommended that protocol parsers utilize this API. Protocol specifications often mandate specific newline sequences. For example, HTTP/1.1 (RFC 8615) mandates that the request line, status line, and headers lines end with CRLF. Since this API operates over a wide range of newline sequences, a protocol parser utilizing this API could exhibit behaviors unintended by the protocol's authors.

This overload is equivalent to calling <xref:System.String.ReplaceLineEndings(System.String)>, passing
<xref:System.Environment.NewLine> as the <em>replacementText</em> parameter.
This overload is equivalent to calling <xref:System.String.ReplaceLineEndings(System.String)>, passing <xref:System.Environment.NewLine> as the <em>replacementText</em> parameter.

This method is guaranteed O(n) complexity, where <em>n</em> is the length of the input string.
This method is guaranteed O(n) complexity, where <em>n</em> is the length of the input string.

]]></format>
]]></format>
</remarks>
</Docs>
</Member>
Expand Down Expand Up @@ -11817,24 +11808,15 @@ This method searches for all newline sequences within the string and canonicaliz

## Remarks

This method searches for all newline sequences within the string and canonicalizes them to the
newline sequence provided by `replacementText`. If `replacementText`
is <xref:System.String.Empty>, all newline sequences within the string will be removed.
This method searches for all newline sequences within the string and canonicalizes them to the newline sequence provided by `replacementText`. If `replacementText` is <xref:System.String.Empty>, all newline sequences within the string will be removed.

It is not recommended that protocol parsers utilize this API. Protocol specifications often
mandate specific newline sequences. For example, HTTP/1.1 (RFC 8615) mandates that the request
line, status line, and headers lines end with CRLF. Since this API operates over a wide range
of newline sequences, a protocol parser utilizing this API could exhibit behaviors unintended
by the protocol's authors.
It is not recommended that protocol parsers utilize this API. Protocol specifications often mandate specific newline sequences. For example, HTTP/1.1 (RFC 8615) mandates that the request line, status line, and headers lines end with CRLF. Since this API operates over a wide range of newline sequences, a protocol parser utilizing this API could exhibit behaviors unintended by the protocol's authors.

The list of recognized newline sequences is CR (U+000D), LF (U+000A), CRLF (U+000D U+000A),
NEL (U+0085), LS (U+2028), FF (U+000C), and PS (U+2029). This list is given by the Unicode
Standard, Sec. 5.8, Recommendation R4 and Table 5-2.
The list of recognized newline sequences is CR (U+000D), LF (U+000A), CRLF (U+000D U+000A), NEL (U+0085), LS (U+2028), FF (U+000C), and PS (U+2029). This list is given by the Unicode Standard, Sec. 5.8, Recommendation R4 and Table 5-2.

This method is guaranteed O(n * r) complexity, where <em>n</em> is the length of the input string,
and where <em>r</em> is the length of `replacementText`.
This method is guaranteed O(n * r) complexity, where <em>n</em> is the length of the input string, and where <em>r</em> is the length of `replacementText`.

]]></format>
]]></format>
</remarks>
</Docs>
</Member>
Expand Down