StudyPlayground / TypeScript-Exercise-Challenges

Typescript exercise & challenges
2 stars 0 forks source link

Type Challenges 2688-StartsWith #64

Open kscory opened 6 months ago

kscory commented 6 months ago

답안을 작성해주세요.

wogha95 commented 6 months ago
type StartsWith<T extends string, U extends string> = T extends `${U}${string}` ? true : false;
kscory commented 5 months ago
type StartsWith<T extends string, U extends string> = T extends `${U}${string}` ? true : false
bananana0118 commented 5 months ago
type StartsWith<T extends string, U extends string> = U extends '' ? true :T extends `${infer First}${U}${infer Rest}`?
  `${First}` extends "" ? 
    true: 
    false :
  false