@stdlib/string-capitalize
v0.3.0
Published
Capitalize the first character in a string.
Downloads
1,062
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 = 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'
See Also
@stdlib/string-capitalize-cli
: CLI package for use as a command-line utility.@stdlib/string-uncapitalize
: uncapitalize the first character of a string.@stdlib/string-uppercase
: convert a string to uppercase.
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-2024. The Stdlib Authors.