La seguente funzione non funziona con caratteri svedesi, ad esempio å/Å/ä/Ä/ö/Ö
.Personaggi svedesi in Go Lang
func StartsWithUppercase(s string) bool {
return (string(s[0]) == strings.ToUpper(string(s[0])))
}
Come si procede per verificare se una stringa inizia con carattere maiuscolo svedese?
w := "åÅäÄöÖ"
for i := 0; i < len(w); i++ {
fmt.Println(i, w[i])
}
risultati in:
1. 195
2. 165
3. 195
4. 133
5. 195
6. 164
7. 195
8. 132
9. 195
10. 182
11. 195
12. 150
Credo [unicode.IsUpper()] (https://golang.org/pkg/unicode/#IsUpper) sarebbe utile per questo. –