首字母转大写其余保留
function firstToUpper(str) {
return str.replace(/( |^)[a-z]/g, (L) => L.toUpperCase())
}
首字母转小写其余保留
function firstLower(str) {
return str.replace(/^./, (L) => L.toLowerCase())
}
function firstToUpper(str) {
return str.replace(/( |^)[a-z]/g, (L) => L.toUpperCase())
}
function firstLower(str) {
return str.replace(/^./, (L) => L.toLowerCase())
}