Inspectopedia Help

'readLine' can be replaced with 'readln' or 'readlnOrNull'

Reports calls to readLine() that can be replaced with readln() or readlnOrNull().

Using corresponding functions makes your code simpler.

The quick-fix replaces readLine()!! with readln() and readLine() with readlnOrNull().


val x = readLine()!! val y = readLine()?.length

After the quick-fix is applied:

val x = readln() val y = readlnOrNull()?.length

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3


Kotlin, @snapshot@

Last modified: 13 July 2023