28. 替换首个匹配字符串

中等0

实现通用类型工具 Replace<S, From, To> ,它将字符串 S 中的第一个子字符串 From 替换为 To

例如:

type replaced = Replace<'types are fun!', 'fun', 'awesome'> // expected to be 'types are awesome!'
评论(0)
题库

TypeScript

加载中...