Golang unicode.To() function example
package unicode
Golang unicode.To() function usage example
package main
import (
"fmt"
"unicode"
)
func main() {
// upper case = 0
UpperCaseRune := unicode.To(0, 'a')
fmt.Printf("%+q\n", UpperCaseRune)
// lower case = 1
LowerCaseRune := unicode.To(1, 'A')
fmt.Printf("%+q\n", LowerCaseRune)
// title case = 2
TitleCaseRune := unicode.To(2, 'a')
fmt.Printf("%+q\n", TitleCaseRune)
}
Output :
'A'
'a'
'A'
Reference :
Advertisement
Something interesting
Tutorials
+50.4k Golang : How to get struct field and value by name
+33.8k Golang : Save image to PNG, JPEG or GIF format.
+15.6k Golang : Get own process identifier
+28.1k Golang : Get time.Duration in year, month, week or day
+11.8k Golang : Qt progress dialog example
+10.8k Golang : Convert a rune to unicode style string \u
+4.2k Unix/Linux : secure copying between servers with SCP command examples
+6k Golang : Mapping Iban to Dunging alphabets
+9.8k Golang : Calculate Relative Strength Index(RSI) example
+13.2k Golang : On enumeration
+9k CodeIgniter : Load different view for mobile devices
+7.4k Golang : Count leading or ending zeros(any item of interest) example