On Tuesday, 29 October 2013 at 20:56:02 UTC, monarch_dodra wrote:
On Tuesday, 29 October 2013 at 10:08:00 UTC, Sergei Nosov wrote:
I guess it's a good thing, it's available online. While looking through it, I also noticed that there are new functions 'stripLeft/stripRight'. I believe it would be more consistent to call those stripFront/stripBack.

Yes, it would be, but they are also a generalization of the
eponymous string functions. Naming the new functions
"stripFront/stripBack" instead of "stripLeft/stripRight" would
itself be the more inconsistent.

For example:
//std.string.stripLeft
assert(stripLeft(" \tHello") == "Hello");
//std.algorithm.stripLeft(R, E)(R r, E e);
assert(stripLeft(" \tHello", ' ') == "\tHello");
//std.algorithm.stripLeft(alias pred, R)(R r);
assert(stripLeft!(Not!isLower)(" \tHello", ' ') == "ello");

But you make a valid point.

How do these string functions handle RTL languages? Even for strings, 'front' and 'back' might be more appropriate than 'left' and 'right'.

Reply via email to