Files
lodash/capitalize.js
John-David Dalton d46bcaa98d Bump to v4.7.0.
2016-03-31 00:33:47 -07:00

24 lines
553 B
JavaScript

define(['./toString', './upperFirst'], function(toString, upperFirst) {
/**
* Converts the first character of `string` to upper case and the remaining
* to lower case.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to capitalize.
* @returns {string} Returns the capitalized string.
* @example
*
* _.capitalize('FRED');
* // => 'Fred'
*/
function capitalize(string) {
return upperFirst(toString(string).toLowerCase());
}
return capitalize;
});