How to convert unicode string to upper case in Go

2 Answers

0 votes
package main
 
import (
    "fmt"
    "strings"
)
 
func main() {
    s := "Привет"
     
    s = strings.ToTitle(s)
     
    fmt.Printf(s)
}
 
 
 
/*
run:
 
ПРИВЕТ
 
*/

 



answered Aug 21, 2020 by avibootz
0 votes
package main
 
import (
    "fmt"
    "strings"
    "unicode"
)
 
func main() {
    s := "Özden Erişirgil"
     
    s = strings.ToTitleSpecial(unicode.TurkishCase, s)
     
    fmt.Printf(s)
}
 
 
 
/*
run:
 
ÖZDEN ERİŞİRGİL
 
*/

 



answered Aug 21, 2020 by avibootz
...