std.algorithm.startsWith only predicate

Freddy via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Oct 18 11:29:50 PDT 2015


On Sunday, 18 October 2015 at 17:58:30 UTC, Meta wrote:
> Is this a simplified use case of some actual code you have? 
> Otherwise, you can just do:
>
>
> bool iden(string str)
> {
>     auto f = str.front;
>     return f.isAlpha || f == '_';
> }

It's simplified, i wanted to check for empty


More information about the Digitalmars-d-learn mailing list