Strings.capitalize()

Capitalize the first (or any) letter in a string.

If the character at the specified position in a string is not a letter, it will be left as-is.

Usage

Hover over inputs/exits for more info.

var Strings = require('machinepack-strings');


// Capitalize the first (or any) letter in a string.

Strings.capitalize({

string: 'villeriño',

at: 0,

}).execSync();

Inputs

string required

The string to capitalize.

'villeriño'
at

The index of the letter to capitalize within the string

0

Exits

error

An unexpected error occurred.

success

OK.

'Villeriño'