ToTitle in Go

Posted by GoDoc
Public (Editable by Users)

ToTitle returns a copy of the string s with all Unicode letters mapped to their Unicode title case.

Go
Edit
package main

import (
	"fmt"
	"strings"
)

func main() {
	// Compare this example to the Title example.
	fmt.Println(strings.ToTitle("her royal highness"))
	fmt.Println(strings.ToTitle("loud noises"))
	fmt.Println(strings.ToTitle("хлеб"))
}