String: Start with

Medium
conditional types
template literal
infer
recursive

Description:

Implement StartsWith<T, U> which takes two exact string types and returns whether T starts with U

For example

type a = StartsWith<'abc', 'ac'> // false type b = StartsWith<'abc', 'ab'> // true type c = StartsWith<'abc', 'abcd'> // false

Code

Loading...