Upper case the first character of a string. Also handles non-string entities, such as objects with a toString
property, numbers and booleans. Empty values (null
and undefined
) will come out as an empty string.
npm install upper-case-first --save
var upperCaseFirst = require('upper-case-first');
upperCaseFirst(null); //=> ""
upperCaseFirst('string'); //=> "String"
MIT