What is a rune in Go?
I've been googling but Golang only says in one line: rune is an alias for int32.
But how come integers are used all around like swapping cases?
The following is a function swapcase. What is all the
And why doesn't switch have any arguments?
&& should mean and but what is r
func SwapRune(r rune) rune {
switch {
case 'a'
Most of them are from http://play.golang.org/p/H6wjLZj6lW
func SwapCase(str string) string {
return strings.Map(SwapRune, str)
}
I understand this is mapping rune to string so that it can return the swapped string. But I do not understand how exactly rune or byte works here.
0 answers
Hot tools Tags
Hot Questions
Popular tool
vc9-vc14 (32+64 bit) runtime library collection (link below)
Download the collection of runtime libraries required for phpStudy installation
VC9 32-bit
VC9 32-bit phpstudy integrated installation environment runtime library
PHP programmer toolbox full version
Programmer Toolbox v1.0 PHP Integrated Environment
VC11 32-bit
VC11 32-bit phpstudy integrated installation environment runtime library
SublimeText3 Chinese version
Chinese version, very easy to use
Hot Topics
20417
7
13577
4






