Files
lodash/capitalize.js
John-David Dalton 6cb3460fce Remove semicolons.
2017-02-05 22:22:04 -08:00

22 lines
494 B
JavaScript

import toString from './toString.js'
import upperFirst from './upperFirst.js'
/**
* Converts the first character of `string` to upper case and the remaining
* to lower case.
*
* @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())
}
export default capitalize