wiki/content/20201123103333-capitalize.md

21 lines
411 B
Markdown
Raw Normal View History

2024-05-06 20:40:05 +00:00
---
2024-10-30 17:34:11 +00:00
date: 2020-11-23
2024-05-06 20:40:05 +00:00
id: 6c64608e-24e8-4f8a-8f22-6b9bba4a3f0c
title: Capitalize
---
# Description
Transforms the first string character to uppercase for [string literal
types](20201123101810-typescript_template_literal_string_type).
# Syntax
``` typescript
type CapitalizedGreeting<T extends string> = `${Capitalize<T>}`
type HELLO = CapitalizedGreeting<"hello">;
// same as
// type HELLO = "Hello";
```