assert(!"".canFind("_")); assert(!"a".canFind("_")); assert("a".canFind("a")); assert(!"a".canFind("ab")); assert("ab".canFind("a")); assert("ab".canFind("b")); assert("ab".canFind("ab")); assert(!"a".canFind("ab")); assert(!"b".canFind("ab"));
assert(!"".canFind('_')); assert(!"a".canFind('_')); assert("a".canFind('a')); assert("a".canFind('a')); assert("ab".canFind('a')); assert("ab".canFind('b'));
Array-specialization of count with default predicate.
TODO Add optimized implementation for needles with length >= largeNeedleLength with no repeat of elements.
TODO reuse return haystack.indexOf(needle) != -1 in both overloads