Sha256: 9b63eb93fa012ad18c56a9fbeddffaeb5437fbdc6ca6f3b19fc45e44ef6e3e77
Contents?: true
Size: 690 Bytes
Versions: 153
Compression:
Stored size: 690 Bytes
Contents
var createCompounder = require('../internal/createCompounder'); /** * Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). * * @static * @memberOf _ * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the start cased string. * @example * * _.startCase('--foo-bar'); * // => 'Foo Bar' * * _.startCase('fooBar'); * // => 'Foo Bar' * * _.startCase('__foo_bar__'); * // => 'Foo Bar' */ var startCase = createCompounder(function(result, word, index) { return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1)); }); module.exports = startCase;
Version data entries
153 entries across 80 versions & 8 rubygems