醉菜鸟 2022-06-13 08:00:09
/** * 首字母大写 * @param str * @returns {*} */ function ucFirst(str) { return str.replace(/\b\w+\b/g, function(word) { return word.substring(0, 1).toUpperCase() + word.substring(1) }) }