TypeScript Utility Types

Capitalize<S> — intrinsic string transformation

Capitalize changes the first UTF-16 code unit using uppercase conversion and leaves the remainder unchanged. It is an intrinsic implemented by the checker, not an ordinary user-defined type alias implementation. The transformation is not locale-aware; it does not change an actual string value. A broad string argument need not produce a finite literal union. Example output: "ReadyNow". Verified with strict TypeScript 5.8.3, ES2022 and Node.js 22.16.0. This utility affects static typing; no runtime validation or transformation is supplied by the type itself.

Formal Syntax & Structure

typescript syntaxtypescript
Capitalize<S>

Parameters & Attributes

NameTypeDescription
SS extends stringString type or union of string types to transform.

Working Example

Example Snippettypescript
type Label = Capitalize<"readyNow">;const label: Label = "ReadyNow";console.log(label);
TypeScript Reference