readText
Platform and version requirements: JVM (1.5), JRE7 (1.5)
fun Path.readText(charset: Charset = Charsets.UTF_8): String
Gets the entire content of this file as a String using UTF-8 or the specified charset.
It's not recommended to use this function on huge files. For reading large files or files of unknown size, open a Reader and read blocks of text sequentially.
Parameters
charset
- character set to use for reading text, UTF-8 by default.
Return the entire content of this file as a String.
© 2010–2021 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io.path/java.nio.file.-path/read-text.html