fix: Fix string.title (#2687)
* fix: unsignedTypeMap type error * fix: string.Title * style: string.Title test
This commit is contained in:
@@ -57,7 +57,7 @@ func (s String) Title() string {
|
||||
if s.IsEmptyOrSpace() {
|
||||
return s.source
|
||||
}
|
||||
return cases.Title(language.English).String(s.source)
|
||||
return cases.Title(language.English, cases.NoLower).String(s.source)
|
||||
}
|
||||
|
||||
// ToCamel converts the input text into camel case
|
||||
|
||||
@@ -54,6 +54,14 @@ func TestTitle(t *testing.T) {
|
||||
src: "go zero",
|
||||
exec: "Go Zero",
|
||||
},
|
||||
{
|
||||
src: "goZero",
|
||||
exec: "GoZero",
|
||||
},
|
||||
{
|
||||
src: "GoZero",
|
||||
exec: "GoZero",
|
||||
},
|
||||
{
|
||||
src: "测试this is data",
|
||||
exec: "测试This Is Data",
|
||||
|
||||
Reference in New Issue
Block a user