GT2/GT2-iOS/node_modules/upper-case-first/upper-case-first.js

18 lines
304 B
JavaScript
Raw Normal View History

2018-02-12 17:26:06 +00:00
var upperCase = require('upper-case')
/**
* Upper case the first character of a string.
*
* @param {String} str
* @return {String}
*/
module.exports = function (str, locale) {
if (str == null) {
return ''
}
str = String(str)
return upperCase(str.charAt(0), locale) + str.substr(1)
}