Sha256: a78ad433a5bc496090368e3bb4afd526a95d5faf35a155f4d5fb1e1b8935a5ff
Contents?: true
Size: 494 Bytes
Versions: 167
Compression:
Stored size: 494 Bytes
Contents
var baseToString = require('../internal/baseToString'); /** * Capitalizes the first character of `string`. * * @static * @memberOf _ * @category String * @param {string} [string=''] The string to capitalize. * @returns {string} Returns the capitalized string. * @example * * _.capitalize('fred'); * // => 'Fred' */ function capitalize(string) { string = baseToString(string); return string && (string.charAt(0).toUpperCase() + string.slice(1)); } module.exports = capitalize;
Version data entries
167 entries across 87 versions & 9 rubygems