Standard library / bytes
bytes.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 []byte) []byteParameters & Attributes
| Name | Type | Description |
|---|---|---|
| s | []byte | Input text or sequence. |
Return Value
[]byte
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 ( "bytes" "fmt")
func main() { fmt.Println(string(bytes.ToTitle([]byte("go"))))}