import { type Str } from "https://deno.land/x/rimbu@0.13.5/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>