The capitalize utility type in Typescript capitalizes the first letter of a word in a StringType.
Structure
type nameOfType = Capitalize<StringType>
Example
type HiString = "hi";
type CapitalizeString = Capitalize<HiString>; //Hi
Published by Muhammad Asfour
Estimated reading time: 1 min
The capitalize utility type in Typescript capitalizes the first letter of a word in a StringType.
type nameOfType = Capitalize<StringType>
type HiString = "hi";
type CapitalizeString = Capitalize<HiString>; //Hi