GuobaGuoba Utils

capitalize

@guoba-ai/utils / string / capitalize

Function: capitalize()

function capitalize<T>(str): Capitalize<T>;

Defined in: string.ts:11

Capitalize the first letter of a string.

Type Parameters

T

T extends string

Parameters

str

T

The string to capitalize

Returns

Capitalize<T>

The string with its first letter uppercased

Example

capitalize('hello') // 'Hello'

On this page