|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
529 bytes
|
| Line | |
|---|
| 1 | var toString = require('./toString'),
|
|---|
| 2 | upperFirst = require('./upperFirst');
|
|---|
| 3 |
|
|---|
| 4 | /**
|
|---|
| 5 | * Converts the first character of `string` to upper case and the remaining
|
|---|
| 6 | * to lower case.
|
|---|
| 7 | *
|
|---|
| 8 | * @static
|
|---|
| 9 | * @memberOf _
|
|---|
| 10 | * @since 3.0.0
|
|---|
| 11 | * @category String
|
|---|
| 12 | * @param {string} [string=''] The string to capitalize.
|
|---|
| 13 | * @returns {string} Returns the capitalized string.
|
|---|
| 14 | * @example
|
|---|
| 15 | *
|
|---|
| 16 | * _.capitalize('FRED');
|
|---|
| 17 | * // => 'Fred'
|
|---|
| 18 | */
|
|---|
| 19 | function capitalize(string) {
|
|---|
| 20 | return upperFirst(toString(string).toLowerCase());
|
|---|
| 21 | }
|
|---|
| 22 |
|
|---|
| 23 | module.exports = capitalize;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.