diff options
Diffstat (limited to 'strings/strings.go')
| -rw-r--r-- | strings/strings.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/strings/strings.go b/strings/strings.go index d822a57d..269e760f 100644 --- a/strings/strings.go +++ b/strings/strings.go @@ -7,6 +7,9 @@ import ( "strings" "github.com/Masterminds/goutils" + "github.com/hairyhenderson/gomplate/v3/conv" + "golang.org/x/text/cases" + "golang.org/x/text/language" ) // Indent - indent each line of the string with the given indent string. @@ -89,7 +92,8 @@ func casePrepare(in string) string { // CamelCase - func CamelCase(in string) string { in = strings.TrimSpace(in) - s := strings.Title(in) + tag := language.Und + s := cases.Title(tag).String(conv.ToString(in)) // make sure the first letter remains lower- or upper-cased s = strings.Replace(s, string(s[0]), string(in[0]), 1) return nonAlphaNum.ReplaceAllString(s, "") |
