Standard library / unicode

unicode.To()

Maps a rune to the selected upper, lower or title case; invalid case selector returns RuneError. Expected stdout: 'a\n'.

Formal Syntax & Structure

go syntaxgo
func To(_case int, r rune) rune

Parameters & Attributes

NameTypeDescription
_caseintCase selector: unicode.UpperCase, LowerCase or TitleCase.
rruneUnicode code point.

Return Value

rune

Maps a rune to the selected upper, lower or title case; invalid case selector returns RuneError.

Working Example

Example Snippetgo
package main
import (  "fmt"  "unicode")
func main() {  fmt.Println(string(unicode.To(unicode.LowerCase, 'A')))}
Go Reference