public static string ReplaceLineEndings(
this string s
)<ExtensionAttribute>
Public Shared Function ReplaceLineEndings (
s As String
) As Stringpublic:
[ExtensionAttribute]
static String^ ReplaceLineEndings(
String^ s
)[<ExtensionAttribute>]
static member ReplaceLineEndings :
s : string -> string This is a polyfill for the .NET 6.0 method String.ReplaceLineEndings(). 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 the newline sequence for the current environment. For example, when running on Windows, all occurrences of non-Windows Newline sequences are replaced with the sequence CRLF. When running on Unix, all occurrences of non-Unix Newline sequences are replaced with a single LF character.
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. |