Standard library / strings

strings.ToTitle()

Maps every rune to Unicode title case; this is not capitalizing only the first letter of each word. Expected stdout: 'GO\n'.

Formal Syntax & Structure

go syntaxgo
func ToTitle(s string) string

Parameters & Attributes

NameTypeDescription
sstringInput text or sequence.

Return Value

string

Maps every rune to Unicode title case; this is not capitalizing only the first letter of each word.

Working Example

Example Snippetgo
package main
import (  "fmt"  "strings")
func main() {  fmt.Println(string(strings.ToTitle("go")))}
Go Reference