webapp
Some checks failed
Docker Build and Publish / publish (push) Failing after 1m33s

This commit is contained in:
Eugene Howe
2026-02-17 09:47:30 -05:00
parent af09672ee3
commit b0957bfa49
102 changed files with 4213 additions and 378 deletions

View File

@@ -0,0 +1,24 @@
package utils
import "strings"
func ToTitleCase(name string) string {
words := strings.Fields(name)
for i, word := range words {
if len(word) > 0 {
// Handle hyphenated names
if strings.Contains(word, "-") {
parts := strings.Split(word, "-")
for j, part := range parts {
if len(part) > 0 {
parts[j] = strings.ToUpper(string(part[0])) + strings.ToLower(part[1:])
}
}
words[i] = strings.Join(parts, "-")
} else {
words[i] = strings.ToUpper(string(word[0])) + strings.ToLower(word[1:])
}
}
}
return strings.Join(words, " ")
}