import { type Str } from "https://deno.land/x/rimbu@1.1.0/typical/index.ts";
const { TakeWhile } = Str;
Returns part of the string as long as its parts match Sub.
Examples
Example 1
Example 1
TakeWhile<'aabc', 'a'> => 'aa'
TakeWhile<'aabc', 'a' | 'b'> => 'aab'
TakeWhile<'aabc', 'q'> => ''
Type Parameters
Sub extends string & NonEmptyString<Sub>