1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | import ( "unicode" ) func Ucfirst(str string ) string { for i, v := range str { return string (unicode.ToUpper(v)) + str[i+1:] } return "" } func Lcfirst(str string ) string { for i, v := range str { return string (unicode.ToLower(v)) + str[i+1:] } return "" } |