<@U0D06TWMA> commented on <@U7VTJDE4R>’s file <htt...
# announcements
u
@Andreas Sinz commented on @Intrux’s file

https://kotlinlang.slack.com/files/U7VTJDE4R/F7WDEPK1Q/screen_shot_2017-11-07_at_1.40.08_pm.png

: I'd remove local state (
val text
) and replace it with a higher order function, something like
Copy code
fun readFromFile(...): String {
    val separator = System.getProperty("line.separator")

    val lines = BufferedReader(path).lineSequence()

    return if(newLine)
        lines.map { it + separator }.joinToString()
     else
        lines.joinToString()
}