# capitalize
> Capitalize the first character in a string.
## Usage
```javascript
var capitalize = require( '@stdlib/string/capitalize' );
```
#### capitalize( str )
Capitalizes the first character in a `string`.
```javascript
var out = capitalize( 'last man standing' );
// returns 'Last man standing'
out = capitalize( 'Hidden Treasures' );
// returns 'Hidden Treasures'
```
## Examples
```javascript
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
```text
Usage: capitalize [options] []
Options:
-h, --help Print this message.
-V, --version Print the package version.
--split sep Delimiter for stdin data. Default: '/\\r?\\n/'.
```
### Notes
- If the split separator is a [regular expression][mdn-regexp], ensure that the `split` option is either properly escaped or enclosed in quotes.
```bash
# Not escaped...
$ echo -n $'beep\nboop' | capitalize --split /\r?\n/
# Escaped...
$ echo -n $'beep\nboop' | capitalize --split /\\r?\\n/
```
- The implementation ignores trailing delimiters.
### Examples
```bash
$ capitalize beep
Beep
```
To use as a [standard stream][standard-streams],
```bash
$ echo -n 'beEp' | capitalize
BeEp
```
By default, when used as a [standard stream][standard-streams], the implementation assumes newline-delimited data. To specify an alternative delimiter, set the `split` option.
```bash
$ echo -n 'beep\tbOOP' | capitalize --split '\t'
Beep
BOOP
```
[standard-streams]: https://en.wikipedia.org/wiki/Standard_streams
[mdn-regexp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
[@stdlib/string/uncapitalize]: https://github.com/stdlib-js/string/tree/main/uncapitalize
[@stdlib/string/uppercase]: https://github.com/stdlib-js/string/tree/main/uppercase