splitter for strings

monarch_dodra via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jun 9 13:02:29 PDT 2014


On Monday, 9 June 2014 at 19:54:08 UTC, Chris wrote:
> I think it makes sense to put any generic range based 
> algorithms (split and so forth) into std.algorithm. It's always 
> my first port of call, when I have a range. However, that you 
> can do
>
> std.string.split([1, 2, 3], 2);
>
> is not exactly a desirable situation.

Right, but "split(hello world)" *is* string specific. It makes 
sense for strings only. It doens't make sense to write "split([1, 
2, 3])", which is why I'm unsatisfied with the current situation.


More information about the Digitalmars-d-learn mailing list