>
> Currently you'd need to do something like:
>
> "hello".iterator().count{ "aeiou".contains(it) }
>
> I think it makes sense to add a direct DGM method in this instance.
> And yes, I suspect that CharSequence versions of most of the Iterable
> DGM methods would be appropriate.
>
Should these go in DGM or StringGroovyMethods? I'm thinking the simplest
solution would be implementations of the form:
static int count(CharSequence seq, Closure cl) {
return count(seq.iterator(), cl);
}
Does that make sense?
Peter