-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Add splitlines? #19759
New issue
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
Comments
Possibly more useful would be a way to iterate by line, as split lines only works well for small files. (Both would be cool too) |
There is |
The difference to to split is automatically handling split(string, r"\n|\r\n") The corresponding function in Python also handles several other linefeed formats and it could be wise to do the same. I recently had few bugs in Weave.jl due to not handling Using |
I'd say that there is no need for a new function ( |
I think |
I see your point now, thanks for clarifying it. |
After #19944 gets merged this could simply be defined as splitlines(str::String, chomp::Bool=true) = readlines(IOBuffer(str), chomp)) |
This issue can be closed: |
I think it would be useful to have a
splitlines
method similar to Pythonhttps://docs.python.org/3/library/stdtypes.html?highlight=splitlines .
I think it would be convenient, at least for me I very often process strings line by line. And it would be useful in order to avoid bugs related to
\r
on Windows.The text was updated successfully, but these errors were encountered: