Last change
on this file since eed0bf8 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
622 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | var createCompounder = require('./_createCompounder');
|
---|
| 2 |
|
---|
| 3 | /**
|
---|
| 4 | * Converts `string`, as space separated words, to lower case.
|
---|
| 5 | *
|
---|
| 6 | * @static
|
---|
| 7 | * @memberOf _
|
---|
| 8 | * @since 4.0.0
|
---|
| 9 | * @category String
|
---|
| 10 | * @param {string} [string=''] The string to convert.
|
---|
| 11 | * @returns {string} Returns the lower cased string.
|
---|
| 12 | * @example
|
---|
| 13 | *
|
---|
| 14 | * _.lowerCase('--Foo-Bar--');
|
---|
| 15 | * // => 'foo bar'
|
---|
| 16 | *
|
---|
| 17 | * _.lowerCase('fooBar');
|
---|
| 18 | * // => 'foo bar'
|
---|
| 19 | *
|
---|
| 20 | * _.lowerCase('__FOO_BAR__');
|
---|
| 21 | * // => 'foo bar'
|
---|
| 22 | */
|
---|
| 23 | var lowerCase = createCompounder(function(result, word, index) {
|
---|
| 24 | return result + (index ? ' ' : '') + word.toLowerCase();
|
---|
| 25 | });
|
---|
| 26 |
|
---|
| 27 | module.exports = lowerCase;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.