Skip to content

Glossary: Kotlin Basics

readln / readlnOrNull

Also written: readln(), readlnOrNull()

`readln()` waits for the user to type a line and gives back the text. `readlnOrNull()` does the same but gives null when there is no more input.

Where the book teaches it

Related terms

nulltoInt / toDouble / toIntOrNull / toDoubleOrNull