elect
07/13/2018, 9:54 AMdropWhile
+ drop
?
if (file.exists())
file.readLines()
.dropWhile { !it.startsWith('#') }.drop(1)
david-wg2
07/13/2018, 10:11 AMreadText
, substring on # then split on newline.. not sure if that's any better though 😬elect
07/13/2018, 10:15 AMBruno
07/13/2018, 10:16 AMfilter
maybe?
file.readLines().filter { !it.startsWith("#") }
you’re gonna have just the lines that don’t start with #edwardwongtl
07/13/2018, 10:22 AMBruno
07/13/2018, 10:23 AMdavid-wg2
07/13/2018, 10:26 AMreadLines()
for huge files eitherelect
07/13/2018, 10:35 AMkarelpeeters
07/13/2018, 11:03 AMuseLines
for large files: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io/java.io.-file/use-lines.html.dropWhile { ... }.drop(1)
is fine I'd say.