capitalize

Capitalize the first character in a string.

Usage

var capitalize = require( '@stdlib/string/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/capitalize' );

var str;

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';

CLI

Usage

Usage: capitalize [options] [<string>]

Options:

  -h,    --help                Print this message.
  -V,    --version             Print the package version.

Examples

$ capitalize beep
Beep

To use as a standard stream,

$ echo -n 'beEp' | capitalize
BeEp