Skip to content
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

Fix 6735: splitLines ignores trailing delimiter #277

Closed
wants to merge 1 commit into from

Conversation

Abscissa
Copy link
Contributor

@andralex
Copy link
Member

This is by design. The '\n' is considered a line terminator, not a separator, such that e.g. splitLines("\n") returns [ "" ], not [ "", "" ]. Both semantics are arguably good, but we shouldn't change from one to the other at this point.

What I suggest you do is add an optional second enum KeepTerminator : bool { no, yes } parameter (incidentally already defined in std.stdio). If true, keep the endlines with the string (similarly to Python's splitlines). Such a method would simplify the implementation of outdent.

@andralex andralex closed this Sep 27, 2011
kuettler pushed a commit to kuettler/phobos that referenced this pull request Feb 6, 2018
Improve contributor .mailmap mapping
merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants