Skip to content

Latest commit

 

History

History
15 lines (9 loc) · 1.85 KB

File metadata and controls

15 lines (9 loc) · 1.85 KB

StartsWith 中等 #template-literal

by jiangshan @jiangshanmeta

接受挑战    English

实现StartsWith<T, U>,接收两个string类型参数,然后判断T是否以U开头,根据结果返回truefalse

例如:

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

返回首页 分享你的解答 查看解答

相关挑战

2693・EndsWith