Skip to content

Commit

Permalink
Fix remarks of String.ReplaceLineEndings (dotnet#7908)
Browse files Browse the repository at this point in the history
  • Loading branch information
xparadoxical authored Apr 4, 2022
1 parent 7536fe5 commit d04ee76
Showing 1 changed file with 10 additions and 28 deletions.
38 changes: 10 additions & 28 deletions xml/System/String.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11756,24 +11756,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 @@ -11811,24 +11802,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

0 comments on commit d04ee76

Please sign in to comment.