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) []byte

Parameters & Attributes

NameTypeDescription
s[]byteInput 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"))))}
Go Reference