user
11/07/2017, 7:50 PMhttps://kotlinlang.slack.com/files/U7VTJDE4R/F7WDEPK1Q/screen_shot_2017-11-07_at_1.40.08_pm.png▾
val text
) and replace it with a higher order function, something like
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()
}