countIf

Undocumented in source. Be warned that the author may not have intended to support it.
  1. size_t countIf(T[] haystack, Pred pred)
  2. size_t countIf(Buffer!(T) haystack, Pred pred)
    size_t
    countIf
    (,
    Pred pred = Pred.init
    )

Examples

auto buffer = createBuffer("gbbbi");
test!("==")(countIf(buffer, ( char c ) { return c == 'b'; }), 3);

Meta