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) stringParameters & Attributes
| Name | Type | Description |
|---|---|---|
| s | string | Input 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")))}