IndentedTextWriter.WriteLine 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將指定的字串寫入文字資料流,跟隨行結束字元。
多載
WriteLine(String, Object, Object) |
使用與指定一樣的語意寫入格式化字串,並跟隨行結束字元。 |
WriteLine(Char[], Int32, Int32) |
將字元的子陣列寫入文字資料流,跟隨行結束字元。 |
WriteLine(String, ReadOnlySpan<Object>) | |
WriteLine(String, Object[]) |
使用與指定一樣的語意寫入格式化字串,並跟隨行結束字元。 |
WriteLine(String, Object) |
使用與指定一樣的語意寫入格式化字串,並跟隨行結束字元。 |
WriteLine(String) |
將指定的字串寫入文字資料流,跟隨行結束字元。 |
WriteLine(Single) |
將 Single 的文字表示寫入文字資料流,跟隨行結束字元。 |
WriteLine(UInt32) |
將 UInt32 的文字表示寫入文字資料流,跟隨行結束字元。 |
WriteLine(Int64) |
將 8 位元組整數的文字表示寫入文字資料流,跟隨行結束字元。 |
WriteLine(Int32) |
將整數的文字表示寫入文字資料流,跟隨行結束字元。 |
WriteLine(Double) |
將 Double 的文字表示寫入文字資料流,跟隨行結束字元。 |
WriteLine(Char[]) |
將字元陣列寫入文字資料流,跟隨行結束字元。 |
WriteLine(Char) |
將字元寫入文字資料流,跟隨行結束字元。 |
WriteLine(Boolean) |
將布林值的文字表示寫入文字資料流,跟隨行結束字元。 |
WriteLine() |
寫入行結束字元。 |
WriteLine(Object) |
將物件的文字表示寫入文字資料流,跟隨行結束字元。 |
WriteLine(String, Object, Object)
使用與指定一樣的語意寫入格式化字串,並跟隨行結束字元。
public:
override void WriteLine(System::String ^ format, System::Object ^ arg0, System::Object ^ arg1);
public override void WriteLine (string format, object? arg0, object? arg1);
public override void WriteLine (string format, object arg0, object arg1);
override this.WriteLine : string * obj * obj -> unit
Public Overrides Sub WriteLine (format As String, arg0 As Object, arg1 As Object)
參數
- format
- String
要使用的格式化字串。
- arg0
- Object
要寫入格式化字串的第一個物件。
- arg1
- Object
要寫入格式化字串的第二個物件。
適用於
WriteLine(Char[], Int32, Int32)
將字元的子陣列寫入文字資料流,跟隨行結束字元。
public:
override void WriteLine(cli::array <char> ^ buffer, int index, int count);
public override void WriteLine (char[] buffer, int index, int count);
override this.WriteLine : char[] * int * int -> unit
Public Overrides Sub WriteLine (buffer As Char(), index As Integer, count As Integer)
參數
- buffer
- Char[]
資料寫入來源的字元陣列。
- index
- Int32
緩衝區中的起始索引。
- count
- Int32
要寫入的字元數。
適用於
WriteLine(String, ReadOnlySpan<Object>)
public:
override void WriteLine(System::String ^ format, ReadOnlySpan<System::Object ^> arg);
public override void WriteLine (string format, scoped ReadOnlySpan<object?> arg);
override this.WriteLine : string * ReadOnlySpan<obj> -> unit
Public Overrides Sub WriteLine (format As String, arg As ReadOnlySpan(Of Object))
參數
- format
- String
- arg
- ReadOnlySpan<Object>
適用於
WriteLine(String, Object[])
使用與指定一樣的語意寫入格式化字串,並跟隨行結束字元。
public:
override void WriteLine(System::String ^ format, ... cli::array <System::Object ^> ^ arg);
public override void WriteLine (string format, params object?[] arg);
public override void WriteLine (string format, params object[] arg);
override this.WriteLine : string * obj[] -> unit
Public Overrides Sub WriteLine (format As String, ParamArray arg As Object())
參數
- format
- String
要使用的格式化字串。
- arg
- Object[]
要輸出的引數陣列。
適用於
WriteLine(String, Object)
使用與指定一樣的語意寫入格式化字串,並跟隨行結束字元。
public:
override void WriteLine(System::String ^ format, System::Object ^ arg0);
public override void WriteLine (string format, object? arg0);
public override void WriteLine (string format, object arg0);
override this.WriteLine : string * obj -> unit
Public Overrides Sub WriteLine (format As String, arg0 As Object)
參數
- format
- String
格式化字串。
- arg0
- Object
要寫入至格式化字串的物件。
適用於
WriteLine(String)
將指定的字串寫入文字資料流,跟隨行結束字元。
public:
override void WriteLine(System::String ^ s);
public override void WriteLine (string? s);
public override void WriteLine (string s);
override this.WriteLine : string -> unit
Public Overrides Sub WriteLine (s As String)
參數
- s
- String
要寫入的字串。
適用於
WriteLine(Single)
將 Single 的文字表示寫入文字資料流,跟隨行結束字元。
public:
override void WriteLine(float value);
public override void WriteLine (float value);
override this.WriteLine : single -> unit
Public Overrides Sub WriteLine (value As Single)
參數
- value
- Single
要寫入的 single
。
適用於
WriteLine(UInt32)
重要
此 API 不符合 CLS 規範。
將 UInt32 的文字表示寫入文字資料流,跟隨行結束字元。
public:
override void WriteLine(System::UInt32 value);
[System.CLSCompliant(false)]
public override void WriteLine (uint value);
[<System.CLSCompliant(false)>]
override this.WriteLine : uint32 -> unit
Public Overrides Sub WriteLine (value As UInteger)
參數
- value
- UInt32
要輸出的 UInt32。
- 屬性
適用於
WriteLine(Int64)
將 8 位元組整數的文字表示寫入文字資料流,跟隨行結束字元。
public:
override void WriteLine(long value);
public override void WriteLine (long value);
override this.WriteLine : int64 -> unit
Public Overrides Sub WriteLine (value As Long)
參數
- value
- Int64
要寫入的 8 位元組整數。
適用於
WriteLine(Int32)
將整數的文字表示寫入文字資料流,跟隨行結束字元。
public:
override void WriteLine(int value);
public override void WriteLine (int value);
override this.WriteLine : int -> unit
Public Overrides Sub WriteLine (value As Integer)
參數
- value
- Int32
要寫入的整數。
適用於
WriteLine(Double)
將 Double 的文字表示寫入文字資料流,跟隨行結束字元。
public:
override void WriteLine(double value);
public override void WriteLine (double value);
override this.WriteLine : double -> unit
Public Overrides Sub WriteLine (value As Double)
參數
- value
- Double
要寫入的 double
。
適用於
WriteLine(Char[])
將字元陣列寫入文字資料流,跟隨行結束字元。
public:
override void WriteLine(cli::array <char> ^ buffer);
public override void WriteLine (char[]? buffer);
public override void WriteLine (char[] buffer);
override this.WriteLine : char[] -> unit
Public Overrides Sub WriteLine (buffer As Char())
參數
- buffer
- Char[]
要寫入的字元陣列。
適用於
WriteLine(Char)
將字元寫入文字資料流,跟隨行結束字元。
public:
override void WriteLine(char value);
public override void WriteLine (char value);
override this.WriteLine : char -> unit
Public Overrides Sub WriteLine (value As Char)
參數
- value
- Char
要寫入的字元。
適用於
WriteLine(Boolean)
將布林值的文字表示寫入文字資料流,跟隨行結束字元。
public:
override void WriteLine(bool value);
public override void WriteLine (bool value);
override this.WriteLine : bool -> unit
Public Overrides Sub WriteLine (value As Boolean)
參數
- value
- Boolean
要寫入的布林值。
適用於
WriteLine()
寫入行結束字元。
public:
override void WriteLine();
public override void WriteLine ();
override this.WriteLine : unit -> unit
Public Overrides Sub WriteLine ()
適用於
WriteLine(Object)
將物件的文字表示寫入文字資料流,跟隨行結束字元。
public:
override void WriteLine(System::Object ^ value);
public override void WriteLine (object? value);
public override void WriteLine (object value);
override this.WriteLine : obj -> unit
Public Overrides Sub WriteLine (value As Object)
參數
- value
- Object
要寫入的物件。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應