@stdlib/string-base-capitalize
v0.3.0
Published
Capitalize the first character in a string.
Downloads
4,395
Readme
capitalize
Capitalize the first character in a string.
Installation
npm install @stdlib/string-base-capitalize
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'
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.