import { type RepeatExactTimes } from "https://deno.land/x/rimbu@1.1.0/typical/str.ts";
Returns a tuple containing the matched part and the rest of the given string if the string start repeats the given Sub exactly N times.
Examples
Example 1
Example 1
RepeatExactTimes<'aabc', 'a', 0> => false
RepeatExactTimes<'aabc', 'a', 1> => false
RepeatExactTimes<'aabc', 'a', 2> => ['aa', 'bc']
RepeatExactTimes<'aabc', 'a', 3> => false
RepeatExactTimes<'aabc', 'a' | 'b', 3> => ['aab', 'c']