System.IO.TextWriter.WriteLine Method

Writes a subarray of characters followed by a line terminator to the text string or stream.

Syntax

public virtual void WriteLine (char[] buffer, int index, int count)

Parameters

buffer
The character array from which data is read.
index
The character position in buffer at which to start reading data.
count
The maximum number of characters to write.

Exceptions

TypeReason
ArgumentNullException buffer is null.
ArgumentException(index + count ) > buffer.Length.
ArgumentOutOfRangeException

index < 0

-or-

count < 0.

System.IO.IOExceptionAn I/O error occurred.

Remarks

This method will write count characters of data into this TextWriter from the buffer character array starting at position index.

This overload is equivalent to calling the TextWriter.Write(Char[]) method followed by TextWriter.WriteLine for each character in buffer between index and (index + count).

The line terminator is defined by the TextWriter.CoreNewLine field.

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

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0