PATH:
usr
/
local
/
lib
/
node_modules
/
bower
/
lib
/
node_modules
/
inquirer
/
node_modules
/
lodash
/
string
var baseToString = require('../internal/baseToString'), charsLeftIndex = require('../internal/charsLeftIndex'), charsRightIndex = require('../internal/charsRightIndex'), isIterateeCall = require('../internal/isIterateeCall'), trimmedLeftIndex = require('../internal/trimmedLeftIndex'), trimmedRightIndex = require('../internal/trimmedRightIndex'); /** * Removes leading and trailing whitespace or specified characters from `string`. * * @static * @memberOf _ * @category String * @param {string} [string=''] The string to trim. * @param {string} [chars=whitespace] The characters to trim. * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. * @returns {string} Returns the trimmed string. * @example * * _.trim(' abc '); * // => 'abc' * * _.trim('-_-abc-_-', '_-'); * // => 'abc' * * _.map([' foo ', ' bar '], _.trim); * // => ['foo', 'bar'] */ function trim(string, chars, guard) { var value = string; string = baseToString(string); if (!string) { return string; } if (guard ? isIterateeCall(value, chars, guard) : chars == null) { return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1); } chars = (chars + ''); return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1); } module.exports = trim;
[-] padLeft.js
[edit]
[-] startCase.js
[edit]
[-] camelCase.js
[edit]
[+]
..
[-] snakeCase.js
[edit]
[-] kebabCase.js
[edit]
[-] unescape.js
[edit]
[-] trimLeft.js
[edit]
[-] capitalize.js
[edit]
[-] endsWith.js
[edit]
[-] template.js
[edit]
[-] escapeRegExp.js
[edit]
[-] pad.js
[edit]
[-] trimRight.js
[edit]
[-] trunc.js
[edit]
[-] templateSettings.js
[edit]
[-] startsWith.js
[edit]
[-] trim.js
[edit]
[-] parseInt.js
[edit]
[-] words.js
[edit]
[-] escape.js
[edit]
[-] padRight.js
[edit]
[-] repeat.js
[edit]
[-] deburr.js
[edit]