Browse Source

更新

master
huangjiajun 1 year ago
parent
commit
4b6f773e06
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      utils/string.go

+ 5
- 3
utils/string.go View File

@@ -212,7 +212,9 @@ func KsortToStr(params map[string]string) []string {
return keys
}
func UderscoreToUpperCamelCase(s string) string {
s = strings.Replace(s, "_", " ", -1)
s = strings.Title(s)
return strings.Replace(s, " ", "", -1)
split := strings.Split(s, "_")
if len(split) == 2 {
s = split[0] + strings.Title(split[1])
}
return s
}

Loading…
Cancel
Save