Golang bytes.ToLower() function example

package bytes

ToLower returns a copy of the byte input slice with all Unicode letters mapped to their lower case.

Golang bytes.ToLower() function usage example

 package main

 import (
 "fmt"
 "bytes"
 )

 func main() {
 str := []byte("ALL CAPITAL LETTERS")

 tolower := bytes.ToLower(str)

 fmt.Println(string(str))
 fmt.Println(string(tolower))

 }

Output :

ALL CAPITAL LETTERS

all capital letters

Reference :

http://golang.org/pkg/bytes/#ToLower

Advertisement