转驼峰兼容字符串为空

This commit is contained in:
白茶清欢 2021-11-09 20:09:31 +08:00
parent 43bd254dde
commit a4f6d5af95

View File

@ -54,6 +54,9 @@ func Md5(str string) string {
// //
// Date : 4:58 下午 2021/10/25 // Date : 4:58 下午 2021/10/25
func SnakeCaseToCamel(str string) string { func SnakeCaseToCamel(str string) string {
if len(str) == 0 {
return ""
}
builder := strings.Builder{} builder := strings.Builder{}
index := 0 index := 0
if str[0] >= 'a' && str[0] <= 'z' { if str[0] >= 'a' && str[0] <= 'z' {