Convert rune to int?

The problem is simpler than it looks. You convert a rune value to an int value with int(r). But your code implies you want the integer value out of the ASCII (or UTF-8) representation of the digit, which you can trivially get with r – ‘0’ as a rune, or int(r – ‘0’) as an … Read more

What is a rune?

Rune literals are just 32-bit integer values (however they’re untyped constants, so their type can change). They represent unicode codepoints. For example, the rune literal ‘a’ is actually the number 97. Therefore your program is pretty much equivalent to: package main import “fmt” func SwapRune(r rune) rune { switch { case 97 <= r && … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)