Capitalize
utilcn/capitalizeFreeUtility
Capitalize the first letter of a string.
Install it
npx shadcn@latest add https://utilcn.dev/r/capitalize.jsonSource
1/**2 * Capitalizes the first character of a string.3 *4 * @param str - The input string.5 * @returns The string with the first character uppercased.6 *7 * @example8 * capitalize("typescript"); // "Typescript"9 */10export function capitalize(str: string): string {11 if (!str) return '';12 return str.charAt(0).toUpperCase() + str.slice(1);13}
Files it writes
More from utilcn
All 17 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Capitalize Allcapitalize-all | utilcn | Utilities | Free | no deps | |
| Environment Server Configurationenv-server | utilcn | Utilities | Free | 1 dep | |
| Generate Presigned Download URLgenerate-presigned-download-url | utilcn | Utilities | Free | 2 deps · 2 files | |
| Generate Presigned Upload URLgenerate-presigned-upload-url | utilcn | Utilities | Free | 2 deps · 2 files | |
| Repeat Padrepeat-pad | utilcn | Utilities | Free | no deps | |
| Reverse Stringreverse-string | utilcn | Utilities | Free | no deps | |
| To Camel Caseto-camel-case | utilcn | Utilities | Free | no deps | |
| To Kebab Caseto-kebab-case | utilcn | Utilities | Free | no deps |
