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
+13.5k Golang : How to get year, month and day?
+14.3k Golang : How to shuffle elements in array or slice?
+17k Golang : Capture stdout of a child process and act according to the result
+7k Golang : constant 20013 overflows byte error message
+16.5k Golang : Merge video(OpenCV) and audio(PortAudio) into a mp4 file
+9.2k Golang : Write multiple lines or divide string into multiple lines
+5.2k Python : Create Whois client or function example
+8.9k Golang : What is the default port number for connecting to MySQL/MariaDB database ?
+8.2k Golang : Emulate NumPy way of creating matrix example
+36k Golang : Get file last modified date and time
+10.6k Golang : How to unmarshal JSON inner/nested value and assign to specific struct?
+6.7k Golang : Skip or discard items of non-interest when iterating example