Golang bytes.ToUpperSpecial() function example
package bytes
ToUpperSpecial returns a copy of the input byte slice with all Unicode letters mapped to their upper case, giving priority to the special casing rules. (See http://golang.org/pkg/bytes/#ToUpperSpecial)
Golang bytes.ToUpperSpecial() function usage
package main
import (
"fmt"
"bytes"
"unicode"
)
func main() {
str := []byte("a funky şğüöıi string. pay attention to i")
toupper := bytes.ToUpper(str)
toupperspecial := bytes.ToUpperSpecial(unicode.AzeriCase, str)
fmt.Println("Original : " + string(str))
fmt.Println("ToUpper : " + string(toupper))
fmt.Println("ToUpperSpecial " + string(toupperspecial))
}
Output :
Original : a funky şğüöıi string. pay attention to i
ToUpper : A FUNKY ŞĞÜÖII STRING. PAY ATTENTION TO I
ToUpperSpecial A FUNKY ŞĞÜÖIİ STRİNG. PAY ATTENTİON TO İ
Reference :
http://golang.org/pkg/bytes/#ToUpperSpecial
Advertisement
Something interesting
Tutorials
+10.7k Golang : Interfacing with PayPal's IPN(Instant Payment Notification) example
+7.5k Golang : Rot13 and Rot5 algorithms example
+7.2k Ubuntu : connect() to unix:/var/run/php5-fpm.sock failed (13: Permission denied) while connecting to upstream
+14.9k Golang : Submit web forms without browser by http.PostForm example
+12.5k Golang : Arithmetic operation with numerical slices or arrays example
+14.9k Golang : Basic authentication with .htpasswd file
+7.3k Golang : How to iterate a slice without using for loop?
+7.4k Golang : Individual and total number of words counter example
+7.7k Gogland : Where to put source code files in package directory for rookie
+7.5k Golang : How to handle file size larger than available memory panic issue
+31.5k Golang : bufio.NewReader.ReadLine to read file line by line