Standard library / bytes

bytes.ToUpper()

Converts Unicode letters to uppercase equivalents; not full locale-aware case mapping. Expected stdout: 'GO É\n'.

Formal Syntax & Structure

go syntaxgo
func ToUpper(s []byte) []byte

Parameters & Attributes

NameTypeDescription
s[]byteInput text or sequence.

Return Value

[]byte

Converts Unicode letters to uppercase equivalents; not full locale-aware case mapping.

Working Example

Example Snippetgo
package main
import (  "bytes"  "fmt")
func main() {  fmt.Println(string(bytes.ToUpper([]byte("go é"))))}
Go Reference