readLines

inline fun Path.readLines(charset: Charset = Charsets.UTF_8): List<String>(source)

Reads the file content as a list of lines.

It's not recommended to use this function on huge files. For reading lines of a large file or a file of unknown size, use Path.forEachLine or Path.useLines.

Since Kotlin

1.5

Return

list of file lines.

Parameters

charset

character set to use for reading text, UTF-8 by default.