We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
readLines
I was just doing Advent of Code and used readLines in a loop, I was confused to see it return a single line... https://nim-lang.org/docs/io.html#readLines%2Cstring
for line in readLines("blah.txt"): echo line
One line
All lines
n
The text was updated successfully, but these errors were encountered:
This confused me too a while ago.
Sorry, something went wrong.
Are you not better off using io.lines() instead, it being an iterator instead of a proc?
io.lines()
https://nim-lang.org/docs/io.html#lines.i%2Cstring
io.lines() is always better except cases when it is not available for example in VM.
Nowadays this: https://github.com/nim-lang/Nim/pull/12284/files#diff-93574743bf0f766ad08398709499ef6aR18 works in the VM, though its not io.lines
io.lines
Successfully merging a pull request may close this issue.
I was just doing Advent of Code and used
readLines
in a loop, I was confused to see it return a single line... https://nim-lang.org/docs/io.html#readLines%2CstringExample
Current Output
One line
Expected Output
All lines
Possible Solution
n
as a default argumentThe text was updated successfully, but these errors were encountered: