On Sunday, October 18, 2015 17:48:18 Freddy via Digitalmars-d-learn wrote: > How do you call startsWith with only a predicate > --- > import std.algorithm; > import std.ascii; > > bool iden(string str) > { > return str.startsWith!(a => a.isAlpha || a == '_'); > } > ---
startsWith doesn't have an overload that takes only a predicate. The existing overloads all require at least one "needle" to search for in the "haystack." An overload that doesn't require a needle could certainly be added, but there isn't one right now. - Jonathan M Davis