mirror of
https://github.com/type-challenges/type-challenges.git
synced 2026-01-25 14:47:17 +00:00
printf

by null @BestMaster-YS
Implement Format<T extends string> generic.
For example,
type FormatCase1 = Format<"%sabc"> // FormatCase1 : string => string
type FormatCase2 = Format<"%s%dabc"> // FormatCase2 : string => number => string
type FormatCase3 = Format<"sdabc"> // FormatCase3 : string
type FormatCase4 = Format<"sd%abc"> // FormatCase4 : string