import { type StartsWith } from "https://deno.land/x/rimbu@0.13.5/typical/str.ts";
If the given string does not start with the given Start
type, returns false.
Otherwise, returns a tuple containing the matched start and the rest.
Examples
Example 1
Example 1
StartsWith<'abcd', 'ab'> => ['ab', 'cd']
StartsWith<'abcd', 'd'> => false
StartsWith<'abcd', 'ab' | 'bc'> => ['ab', 'cd']
StartsWith<'abcd', 'ab' | 'a'> => ['ab', 'cd'] | ['a', 'bcd']
Type Parameters
Start extends string & NonEmptyString<Start>