Редагувати

Поділитися через


StreamWriter.WriteLine Method

Definition

Overloads

WriteLine(String, Object, Object, Object)

Writes out a formatted string and a new line to the stream, using the same semantics as Format(String, Object).

WriteLine(String, Object, Object)

Writes a formatted string and a new line to the stream, using the same semantics as the Format(String, Object, Object) method.

WriteLine(String, ReadOnlySpan<Object>)

Writes out a formatted string and a new line to the stream, using the same semantics as Format(String, ReadOnlySpan<Object>).

WriteLine(String)

Writes a string to the stream, followed by a line terminator.

WriteLine(String, Object)

Writes a formatted string and a new line to the stream, using the same semantics as the Format(String, Object) method.

WriteLine(ReadOnlySpan<Char>)

Writes the text representation of a character span to the stream, followed by a line terminator.

WriteLine(String, Object[])

Writes out a formatted string and a new line to the stream, using the same semantics as Format(String, Object).

WriteLine(String, Object, Object, Object)

Source:
StreamWriter.cs
Source:
StreamWriter.cs
Source:
StreamWriter.cs

Writes out a formatted string and a new line to the stream, using the same semantics as Format(String, Object).

public:
 override void WriteLine(System::String ^ format, System::Object ^ arg0, System::Object ^ arg1, System::Object ^ arg2);
public override void WriteLine (string format, object? arg0, object? arg1, object? arg2);
override this.WriteLine : string * obj * obj * obj -> unit
Public Overrides Sub WriteLine (format As String, arg0 As Object, arg1 As Object, arg2 As Object)

Parameters

format
String

A composite format string.

arg0
Object

The first object to format and write.

arg1
Object

The second object to format and write.

arg2
Object

The third object to format and write.

Remarks

See WriteLine(String, Object, Object, Object) for a description of the composite formatting capabilities offered.

Applies to

WriteLine(String, Object, Object)

Source:
StreamWriter.cs
Source:
StreamWriter.cs
Source:
StreamWriter.cs

Writes a formatted string and a new line to the stream, using the same semantics as the Format(String, Object, Object) method.

public:
 override void WriteLine(System::String ^ format, System::Object ^ arg0, System::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)

Parameters

format
String

A composite format string.

arg0
Object

The first object to format and write.

arg1
Object

The second object to format and write.

Remarks

See WriteLine(String, Object, Object) for a description of the composite formatting capabilities offered.

Applies to

WriteLine(String, ReadOnlySpan<Object>)

Writes out a formatted string and a new line to the stream, using the same semantics as Format(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))

Parameters

format
String

A composite format string.

arg
ReadOnlySpan<Object>

An object span that contains zero or more objects to format and write.

Applies to

WriteLine(String)

Source:
StreamWriter.cs
Source:
StreamWriter.cs
Source:
StreamWriter.cs

Writes a string to the stream, followed by a line terminator.

public:
 override void WriteLine(System::String ^ value);
public override void WriteLine (string? value);
public override void WriteLine (string value);
override this.WriteLine : string -> unit
Public Overrides Sub WriteLine (value As String)

Parameters

value
String

The string to write. If value is null, only the line terminator is written.

Remarks

This overload is equivalent to the TextWriter.Write(Char[]) overload.

The line terminator is defined by the CoreNewLine field.

This method does not search the specified string for individual newline characters (hexadecimal 0x000a) and replace them with NewLine.

For a list of common I/O tasks, see Common I/O Tasks.

Applies to

WriteLine(String, Object)

Source:
StreamWriter.cs
Source:
StreamWriter.cs
Source:
StreamWriter.cs

Writes a formatted string and a new line to the stream, using the same semantics as the Format(String, Object) method.

public:
 override void WriteLine(System::String ^ format, System::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)

Parameters

format
String

A composite format string.

arg0
Object

The object to format and write.

Remarks

See WriteLine(String, Object) for a description of the composite formatting capabilities offered.

Applies to

WriteLine(ReadOnlySpan<Char>)

Source:
StreamWriter.cs
Source:
StreamWriter.cs
Source:
StreamWriter.cs

Writes the text representation of a character span to the stream, followed by a line terminator.

public:
 override void WriteLine(ReadOnlySpan<char> buffer);
public override void WriteLine (ReadOnlySpan<char> buffer);
override this.WriteLine : ReadOnlySpan<char> -> unit
Public Overrides Sub WriteLine (buffer As ReadOnlySpan(Of Char))

Parameters

buffer
ReadOnlySpan<Char>

The character span to write to the stream.

Remarks

The text representation of the specified value is produced by calling the ReadOnlySpan<Char>.ToString method.

The line terminator is defined by the CoreNewLine field.

For a list of common I/O tasks, see Common I/O Tasks.

Applies to

WriteLine(String, Object[])

Source:
StreamWriter.cs
Source:
StreamWriter.cs
Source:
StreamWriter.cs

Writes out a formatted string and a new line to the stream, using the same semantics as Format(String, Object).

public:
 override void WriteLine(System::String ^ format, ... cli::array <System::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())

Parameters

format
String

A composite format string.

arg
Object[]

An object array that contains zero or more objects to format and write.

Remarks

See WriteLine(String, Object[]) for a description of the composite formatting capabilities offered.

Applies to