import { type Str } from "https://deno.land/x/rimbu@1.1.0/typical/index.ts";
const { SplitAt } = Str;
Returns false if the given string does not contain the given Middle
type,
or a 3-tuple containing the start, the matched middle, and the rest.
Examples
Example 1
Example 1
SplitAt<'abcd', 'bc'> => ['a', 'bc', 'd']
SplitAt<'abcd', 'ef'> => false
SplitAt<'abcd', 'b' | 'c'> => ['a', 'b', 'cd'] | ['ab', 'c', 'd']
Type Parameters
Middle extends string & NonEmptyString<Middle>