I have this code. How to make it jump out of while loop? I mean what should be input? I have entered nothing and just pressed the enter button but it takes it as string. And I also tried 0 and it did not work. "this line" never being printed to console. any ideas?
Copy code
fun main(args: Array<String>) {
var line = readLine()
while (line !=null) {
println(line)
line = readLine()
}
println("this line")
}
m
Marat Akhin
01/16/2020, 4:57 PM
Try
Ctrl + D
m
MaHDi
01/16/2020, 4:59 PM
I wanted something in code. I guess my code is for the time you are getting your input from file ...