Golang bytes.ToUpper() function example
package bytes
ToUpper returns a copy of the input byte slice with all Unicode letters mapped to their upper case.
Golang bytes.ToUpper() function usage example
package main
import (
"fmt"
"bytes"
)
func main() {
str := []byte("a funky şğüöıi string.")
toupper := bytes.ToUpper(str)
fmt.Println("Original : " + string(str))
fmt.Println("ToUpper : " + string(toupper))
}
Output :
Original : a funky şğüöıi string.
ToUpper : A FUNKY ŞĞÜÖII STRING.
Reference :
Advertisement
Something interesting
Tutorials
+18.8k Golang : convert int to string
+7.2k Golang : Array mapping with Interface
+17.8k Golang : Read data from config file and assign to variables
+10.3k Golang : How to profile or log time spend on execution?
+4.9k Which content-type(MIME type) to use for JSON data
+31k Golang : Interpolating or substituting variables in string examples
+9.7k Golang : Populate slice with sequential integers example
+9.7k Golang : Sort and reverse sort a slice of floats
+13.5k Golang : How to get year, month and day?
+18.4k Golang : How to get hour, minute, second from time?
+9.8k PHP : Get coordinates latitude/longitude from string
+29.6k Golang : How to create new XML file ?