Uppercase<S>

Converts each character in the string literal type S to uppercase.

Since TS 4.1 Spec ↗

Syntax

Uppercase<StringType>

Returns

string literal type — A string literal type with every character uppercased.

Examples

type Yell = Uppercase<'hello'>; // 'HELLO'
type EventName<T extends string> = `on${Uppercase<T>}`;
type Click = EventName<'click'>; // 'onCLICK'

Notes

An intrinsic string-manipulation type implemented in the compiler. It distributes over unions and works on template literal types. Has no runtime representation; it only transforms types.

See also