Export (0) Print
Expand All

Environment.NewLine Property

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.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft