Skip to content

dependabit / utils/src / capitalize

Function: capitalize()

ts
function capitalize(str): string;

Defined in: packages/utils/src/string.ts:16

Capitalizes the first letter of a string.

Parameters

ParameterTypeDescription
strstringThe string to capitalize.

Returns

string

The capitalized string.

Example

ts
capitalize('hello'); // 'Hello'

Released under the MIT License.