Bug 15596 – strip with delimiter?

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-01-23T07:52:05Z
Last change time
2020-03-21T03:56:34Z
Assigned to
No Owner
Creator
Manu

Comments

Comment #0 by turkeyman — 2016-01-23T07:52:05Z
std.string.strip() removes whitespace, but the docs make no mention of a version that receives a set of delimiters. If it exists, it should be documented/linked, if it doesn't, it should probably be added.
Comment #1 by b2.temp — 2016-02-28T03:10:12Z
Since std.algorithm.mutation.strip/Left/Right do the job (http://dlang.org/phobos/std_algorithm_mutation.html#.strip) I think your report is invalid.
Comment #2 by turkeyman — 2016-02-28T05:18:17Z
(In reply to b2.temp from comment #1) > Since std.algorithm.mutation.strip/Left/Right do the job > (http://dlang.org/phobos/std_algorithm_mutation.html#.strip) > I think your report is invalid. "If it exists, it should be documented/linked"
Comment #3 by turkeyman — 2016-02-28T05:23:35Z
It is so hard to do string manipulation in phobos. Nobody I've encountered yet can find most of the functions, they're scattered among 4, 5, 6? modules. Unless you already know what the function names are, and where they are, how can people find what they want? They do an exhaustive search through a bunch of modules hoping to stumble upon it. My feeling is that it wouldn't hurt for std.string to alias the hell out of other modules and make all the conventional string operations available in one place.
Comment #4 by b2.temp — 2016-02-28T06:47:43Z
(In reply to Manu from comment #3) > It is so hard to do string manipulation in phobos. Nobody I've encountered > yet can find most of the functions, they're scattered among 4, 5, 6? > modules. Unless you already know what the function names are, and where they > are, how can people find what they want? They do an exhaustive search > through a bunch of modules hoping to stumble upon it. > > My feeling is that it wouldn't hurt for std.string to alias the hell out of > other modules and make all the conventional string operations available in > one place. I agree, after reading your BR, I've myself done the error to write a popWhile() function using a predicate for my user lib after what I've remembered about algorithm.mutation, but it was too late... Maybe a note in the std.string doc: "see also: for more generic strip funcyion..."
Comment #5 by ag0aep6g — 2016-02-28T10:24:39Z
(In reply to b2.temp from comment #4) > Maybe a note in the std.string doc: "see also: for more generic strip > funcyion..." Already there: "There is a rich set of functions for string handling defined in other modules. Functions related to Unicode and ASCII are found in std.uni and std.ascii, respectively. Other functions that have a wider generality than just strings can be found in std.algorithm and std.range."
Comment #6 by ag0aep6g — 2016-02-28T10:26:58Z
(In reply to ag0aep6g from comment #5) > (In reply to b2.temp from comment #4) > > Maybe a note in the std.string doc: "see also: for more generic strip > > funcyion..." > > Already there: "There is a rich set of functions for string handling defined > in other modules. Functions related to Unicode and ASCII are found in > std.uni and std.ascii, respectively. Other functions that have a wider > generality than just strings can be found in std.algorithm and std.range." Whoops, you were talking about strip's docs specifically. Sorry for the noise.
Comment #7 by github-bugzilla — 2016-02-29T22:26:56Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/1d7920d38311c94a00389bafaf6299952848317e fixed issue 15596 https://github.com/D-Programming-Language/phobos/commit/098ce234cff2be2345d7f2f5f7022f74c2566a88 Merge pull request #4029 from BBasile/issue-15596 fixed issue 15596 - mention algorithm.mutation.stripXXX in std.string.stripXXX comments