You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Operating System & Odin Version:
Please paste odin report output:
Odin: dev-2023-12:bf9ae77f
OS: Ubuntu 22.04.3 LTS, Linux 5.15.133.1-microsoft-standard-WSL2
CPU: 12th Gen Intel(R) Core(TM) i7-12700H
RAM: 15838 MiB
Expected Behavior
strings.split_lines should return just the number of lines in the text file
Current Behavior
What is the current behavior?
strings.split_lines when coupled with os.read_entire_file will always return 1 extra empty line
Failure Information (for bugs)
Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
use os.read_entire_file to read a text file
use strings.split_lines to get the file content as an array
print the number of lines
Failure Logs
Please include any relevant log snippets or files here.
For most file editors or even most languages when they do split_lines, they don't expect to see a trailing empty line. Whether it's correct because there is a trailing \n at the end of the last line there should be an extra empty line or not, it doesn't go against expectations and makes parsing text files more dificult because you have to remember there is an extra empty line that you have to ignore.
The text was updated successfully, but these errors were encountered:
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Operating System & Odin Version:
Please paste
odin report
output:Expected Behavior
strings.split_lines
should return just the number of lines in the text fileCurrent Behavior
What is the current behavior?
strings.split_lines
when coupled withos.read_entire_file
will always return 1 extra empty lineFailure Information (for bugs)
Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
os.read_entire_file
to read a text filestrings.split_lines
to get the file content as an arrayFailure Logs
Please include any relevant log snippets or files here.
For most file editors or even most languages when they do split_lines, they don't expect to see a trailing empty line. Whether it's correct because there is a trailing \n at the end of the last line there should be an extra empty line or not, it doesn't go against expectations and makes parsing text files more dificult because you have to remember there is an extra empty line that you have to ignore.
The text was updated successfully, but these errors were encountered: