4 Intrinsic String Manipulation Types In TypeScript

4 Intrinsic String Manipulation Types In TypeScript

In TypeScript, there are four types that help developers handle string manipulation. These types are built-in to the compiler and you can't build your own implementation for them. Additionally, they can’t be found in the .d.ts files included with TypeScript.

Uppercase

Transform each charcater to uppercase.

type Name = "John"

type Modifiedname = Uppercase<Name>

Lowercase

Convert each character of a string to lowercase.

type Name = "JOHN"

type ModifiedName = Lowercase<Name>

Capitalize

Transform first character of a string to uppercase.

type Name = "john"

type ModifiedName = Capitalize<Name>

Uncapitalize

Converts first character of a string to lowercase.

type Name = "John"

type modifiedName = Uncapitalize<Name>