Skip to content
Snippets Groups Projects
Commit e16d1c9d authored by Jano Hendriks's avatar Jano Hendriks
Browse files

Made string lowercase before making it sentence case

parent d8aa2053
Branches
Tags v1.43.0
No related merge requests found
......@@ -238,8 +238,10 @@ func KeyToHumanReadable(s string) string {
}
func SentenceCase(str string) string {
for i, v := range str {
return string(unicode.ToUpper(v)) + str[i+1:]
if len(str) > 0 {
str = strings.ToLower(str)
r := []rune(str)
return string(append([]rune{unicode.ToUpper(r[0])}, r[1:]...))
}
return ""
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment