Tweak string method doc examples. [ci skip]

This commit is contained in:
John-David Dalton
2015-01-02 18:59:45 -06:00
parent b714c6b746
commit fab5daacf8

View File

@@ -9176,14 +9176,14 @@
* @returns {string} Returns the camel cased string. * @returns {string} Returns the camel cased string.
* @example * @example
* *
* _.camelCase('Hello world'); * _.camelCase('Foo Bar');
* // => 'helloWorld' * // => 'fooBar'
* *
* _.camelCase('--hello-world'); * _.camelCase('--foo-bar');
* // => 'helloWorld' * // => 'fooBar'
* *
* _.camelCase('__hello_world__'); * _.camelCase('__foo_bar__');
* // => 'helloWorld' * // => 'fooBar'
*/ */
var camelCase = createCompounder(function(result, word, index) { var camelCase = createCompounder(function(result, word, index) {
word = word.toLowerCase(); word = word.toLowerCase();
@@ -9331,14 +9331,14 @@
* @returns {string} Returns the kebab cased string. * @returns {string} Returns the kebab cased string.
* @example * @example
* *
* _.kebabCase('Hello world'); * _.kebabCase('Foo Bar');
* // => 'hello-world' * // => 'foo-bar'
* *
* _.kebabCase('helloWorld'); * _.kebabCase('fooBar');
* // => 'hello-world' * // => 'foo-bar'
* *
* _.kebabCase('__hello_world__'); * _.kebabCase('__foo_bar__');
* // => 'hello-world' * // => 'foo-bar'
*/ */
var kebabCase = createCompounder(function(result, word, index) { var kebabCase = createCompounder(function(result, word, index) {
return result + (index ? '-' : '') + word.toLowerCase(); return result + (index ? '-' : '') + word.toLowerCase();
@@ -9537,14 +9537,14 @@
* @returns {string} Returns the snake cased string. * @returns {string} Returns the snake cased string.
* @example * @example
* *
* _.snakeCase('Hello world'); * _.snakeCase('Foo Bar');
* // => 'hello_world' * // => 'foo_bar'
* *
* _.snakeCase('--hello-world'); * _.snakeCase('--foo-bar');
* // => 'hello_world' * // => 'foo_bar'
* *
* _.snakeCase('helloWorld'); * _.snakeCase('fooBar');
* // => 'hello_world' * // => 'foo_bar'
*/ */
var snakeCase = createCompounder(function(result, word, index) { var snakeCase = createCompounder(function(result, word, index) {
return result + (index ? '_' : '') + word.toLowerCase(); return result + (index ? '_' : '') + word.toLowerCase();
@@ -9792,11 +9792,14 @@
* @returns {string} Returns the trimmed string. * @returns {string} Returns the trimmed string.
* @example * @example
* *
* _.trim(' fred '); * _.trim(' abc ');
* // => 'fred' * // => 'abc'
* *
* _.trim('-_-fred-_-', '_-'); * _.trim('-_-abc-_-', '_-');
* // => 'fred' * // => 'abc'
*
* _.map([' foo ', ' bar '], _.trim);
* // => ['foo', 'bar]
*/ */
function trim(string, chars, guard) { function trim(string, chars, guard) {
var value = string; var value = string;
@@ -9823,11 +9826,11 @@
* @returns {string} Returns the trimmed string. * @returns {string} Returns the trimmed string.
* @example * @example
* *
* _.trimLeft(' fred '); * _.trimLeft(' abc ');
* // => 'fred ' * // => 'abc '
* *
* _.trimLeft('-_-fred-_-', '_-'); * _.trimLeft('-_-abc-_-', '_-');
* // => 'fred-_-' * // => 'abc-_-'
*/ */
function trimLeft(string, chars, guard) { function trimLeft(string, chars, guard) {
var value = string; var value = string;
@@ -9853,11 +9856,11 @@
* @returns {string} Returns the trimmed string. * @returns {string} Returns the trimmed string.
* @example * @example
* *
* _.trimRight(' fred '); * _.trimRight(' abc ');
* // => ' fred' * // => ' abc'
* *
* _.trimRight('-_-fred-_-', '_-'); * _.trimRight('-_-abc-_-', '_-');
* // => '-_-fred' * // => '-_-abc'
*/ */
function trimRight(string, chars, guard) { function trimRight(string, chars, guard) {
var value = string; var value = string;