Browse Source

Fix mistake

pull/533/head
5 years ago committed by xpetit
parent
commit
2b1e04e3c7
  1. 4
      go/tests/capitalize_test/main.go

4
go/tests/capitalize_test/main.go

@ -12,12 +12,12 @@ import (
func capitalize(s string) string {
r := []rune(strings.ToLower(s))
if unicode.IsLower(r[0]) {
if unicode.Is(unicode.Latin, r[0]) {
r[0] = unicode.ToUpper(r[0])
}
for i := 1; i < len(r); i++ {
if !unicode.Is(unicode.ASCII_Hex_Digit, r[i-1]) && unicode.IsLower(r[i]) {
if !unicode.IsDigit(r[i-1]) && !unicode.Is(unicode.Latin, r[i-1]) {
r[i] = unicode.ToUpper(r[i])
}
}

Loading…
Cancel
Save