Environment.NewLine Property

July 28, 2014

Gets the newline string defined for this environment.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

public static string NewLine { get; }

Property Value

Type: System.String
A string containing "\r\n" for non-Unix platforms,
or
a string containing "\n" for Unix platforms.

The property value of NewLine is a constant customized specifically for the current platform and implementation of the .NET Framework.

The functionality provided by NewLine is often what is meant by the terms newline, line feed, line break, carriage return, CRLF, and end of line.

NewLine can be used in conjunction with language-specific newline support such as the escape characters '\r' and '\n' in Microsoft C# and C/C++, or vbCrLf in Microsoft Visual Basic.

NewLine is automatically appended to text processed by the Console.WriteLine and StringBuilder.AppendLine methods.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft