README
capitalize
Capitalize the first character in a string.
Installation
npm install @stdlib/string-capitalize
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
Installation
To use the module as a general utility, install the module globally
npm install -g @stdlib/string-capitalize
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
Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2021. The Stdlib Authors.