readln

Common
JVM
JS
Native
1.6
For JVM

Reads a line of input from the standard input stream and returns it, or throws a RuntimeException if EOF has already been reached when readln is called.

LF or CRLF is treated as the line terminator. Line terminator is not included in the returned string.

The input is decoded using the system default Charset. A CharacterCodingException is thrown if input is malformed.

For Common

Reads a line of input from the standard input stream and returns it, or throws a RuntimeException if EOF has already been reached when readln is called.

LF or CRLF is treated as the line terminator. Line terminator is not included in the returned string.

Currently this function is not supported in Kotlin/JS and throws UnsupportedOperationException.

For Native

Reads a line of input from the standard input stream and returns it, or throws a RuntimeException if EOF has already been reached when readln is called.

LF or CRLF is treated as the line terminator. Line terminator is not included in the returned string.

The input is interpreted as UTF-8. Invalid bytes are replaced by the replacement character '\uFFFD'.