Appearance
将字符串的首字母转换为大写,其他字符保持不变。
function capitalize(str: string): string
str
string
对于空字符串,直接返回空字符串,不会抛出错误。函数支持所有 Unicode 字符,包括中文、表情符号等。