Skip to content

Instantly share code, notes, and snippets.

@jmatsu
Last active September 25, 2015 12:05
Show Gist options
  • Save jmatsu/08969c9f2c917f5f48e9 to your computer and use it in GitHub Desktop.
Save jmatsu/08969c9f2c917f5f48e9 to your computer and use it in GitHub Desktop.
String line;

while((line = br.readLine()!=null) {
  // do something
}
var line: String?

do {
    line = readLine()
} while (when(line) {
    null -> false
    else -> {
        // do something
        true
    }
})
$(File).forEachLine {
  // do something
}
Contents can't be empty.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment