Title in Go

Posted by GoDoc
Public (Editable by Users)

Title returns a copy of the string s with all Unicode letters that begin words mapped to their Unicode title case.

Go
Edit
package main

import (
	"fmt"
	"strings"
)

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