capitalize

Capitalize the first character in a string.

Usage

var capitalize = require( '@stdlib/string/base/capitalize' );

capitalize( str )

Capitalizes the first character in a string.

var out = capitalize( 'last man standing' );
// returns 'Last man standing'

out = capitalize( 'Hidden Treasures' );
// returns 'Hidden Treasures'

Examples

var capitalize = require( '@stdlib/string/base/capitalize' );

var str = capitalize( 'last man standing' );
// returns 'Last man standing'

str = capitalize( 'presidential election' );
// returns 'Presidential election'

str = capitalize( 'javaScript' );
// returns 'JavaScript'

str = capitalize( 'Hidden Treasures' );
// returns 'Hidden Treasures'
Did you find this page helpful?