import { type Str } from "https://deno.land/x/rimbu@1.2.0/typical/index.ts";
const { Count } = Str;
Returns the amount of times the given Sub
type is encountered in the given string.
Examples
Example 1
Example 1
Count<'abcba', 'c'> => 1
Count<'abcba', 'a' | 'c'> => 3
Count<'abcba', 'q'> => 0
Type Parameters
Sub extends string & NonEmptyString<Sub>