共用方式為


TextWriter.NewLine Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets the line terminator string used by the current TextWriter.

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

Syntax

'Declaration
Public Overridable Property NewLine As String
public virtual string NewLine { get; set; }

Property Value

Type: System.String
The line terminator string for the current TextWriter.

Remarks

The default line terminator string is a carriage return followed by a line feed ("\r\n").

The line terminator string is written to the text stream whenever one of the WriteLine methods is called. In order for text written by the TextWriter to be readable by a TextReader, only "\n" or "\r\n" should be used as terminator strings. If NewLine is set to nulla null reference (Nothing in Visual Basic), the default newline character is used instead.

Version Information

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

Platforms

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