readlnOrNull

expect fun readlnOrNull(): String?(source)

Reads a line of input from the standard input stream and returns it, or return null if EOF has already been reached when readlnOrNull 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.

Since Kotlin

1.6
actual fun readlnOrNull(): String?(source)

Since Kotlin

1.6
actual fun readlnOrNull(): String?(source)

Reads a line of input from the standard input stream and returns it, or return null if EOF has already been reached when readlnOrNull 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.

Since Kotlin

1.6
actual external fun readlnOrNull(): String?(source)

Reads a line of input from the standard input stream and returns it, or return null if EOF has already been reached when readlnOrNull 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'.

Since Kotlin

1.6
actual fun readlnOrNull(): String?(source)

Since Kotlin

1.8
actual fun readlnOrNull(): String?(source)

Since Kotlin

1.8