import { type Str } from "https://deno.land/x/rimbu@1.1.0/typical/index.ts";
const { EndsWith } = Str;
If the given string does not end with the given End
type, returns false.
Otherwise, returns a tuple containing the start and the matched end.
Examples
Example 1
Example 1
EndsWith<'abcd', 'cd'> => ['ab', 'cd']
EndsWith<'abcd', 'a'> => false
EndsWith<'abcd', 'cd' | 'de'> => ['ab', 'cd']
EndsWith<'abcd', 'cd' | 'd'> => ['ab', 'cd'] | ['abc', 'd']
Type Parameters
End extends string & NonEmptyString<End>