-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Also, it is probably better to use the title case built-in method:
package main
import (
"fmt"
"golang.org/x/text/cases"
"golang.org/x/text/language"
)
func main() {
text := "welcome to the dollhouse!"
// Create a Caser object for the desired language (Und for undefined/generic language)
// and use its String() method to transform the text.
// cases.Title also lowercases the remaining letters by default.
titleCased := cases.Title(language.Und).String(text)
fmt.Println(titleCased) // Output: Welcome To The Dollhouse!
}
Originally posted by @nathanklick in #371 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels