Skip to content

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