TextWriter.NewLine 屬性

定義

取得或設定目前 TextWriter 所使用的行結束字元字串。

public:
 virtual property System::String ^ NewLine { System::String ^ get(); void set(System::String ^ value); };
public virtual string NewLine { get; set; }
member this.NewLine : string with get, set
Public Overridable Property NewLine As String

屬性值

目前 TextWriter 的行結束字元字串。

備註

對於非 Unix 平臺,預設行終止符字串是歸位字元,後面接著換行字元 (『\r\n』) 。 針對 Unix 平臺,它是 (『\n』) 的換行字元。

每當呼叫其中 WriteLine 一個方法時,行終止符字串就會寫入文字數據流。 為了讓 所 TextWriter 寫入的文字可由 讀取 TextReader,應該只使用 「\n」 或 「\r\n」 做為終止符字串。 如果 NewLine 設定為 null,則會改用預設換行符。

如需一般 I/O 工作的清單,請參閱 一般 I/O 工作

適用於

另請參閱