Mono Class Library: System.Console Overview | Members

System.Console.ReadLine Method

Reads the next line of characters from the Console.InSystem.IO.TextReader.

public static string ReadLine ()

Returns

A string containing the next line from the input stream, or null if the end of the input stream has already been reached.

Exceptions

TypeReason
System.IO.IOExceptionAn I/O error occurred.
OutOfMemoryExceptionThere is insufficient memory to allocate a buffer for the returned string.

Remarks

A line is defined as a sequence of characters followed by a carriage return (Unicode 0x000d), a line feed (Unicode 0x000a), or a Environment.NewLine. The returned string does not contain the terminating character(s).

Requirements

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