public static string ReplaceLineEndings(
this string s,
string replacementText
)<ExtensionAttribute>
Public Shared Function ReplaceLineEndings (
s As String,
replacementText As String
) As Stringpublic:
[ExtensionAttribute]
static String^ ReplaceLineEndings(
String^ s,
String^ replacementText
)[<ExtensionAttribute>]
static member ReplaceLineEndings :
s : string *
replacementText : string -> string This is a polyfill for the .NET 6.0 method String.ReplaceLineEndings(String). The method should therefore only be used in the extension method syntax. It throws a NullReferenceException if s is null in order to show identical behavior to the original .NET method.
The method searches for all newline sequences within s and canonicalizes them to match replacementText.
The list of recognized newline sequences is:
This list is specified by the Unicode standard (Sec. 5.8, Recommendation R4 and Table 5-2).
| NullReferenceException | s is null. |
| ArgumentNullException | replacementText is null. |