公众号回复调整

This commit is contained in:
Jason
2022-09-30 14:05:38 +08:00
parent 8052475e40
commit e191fc8d26
9 changed files with 152 additions and 66 deletions

View File

@@ -160,3 +160,12 @@ export const getNonDuplicateID = (length = 8) => {
idStr += Math.random().toString(36).substring(3, length)
return idStr
}
/**
* @description 单词首字母大写
* @param { String } str
* @return { String } id
*/
export const firstToUpperCase = (str = '') => {
return str.toLowerCase().replace(/( |^)[a-z]/g, ($1) => $1.toUpperCase())
}