1 package stringsx 2 3 import "unicode" 4 5 // ToLowerInitial converts a string's first character to lower case. 6 func ToLowerInitial(s string) string { 7 if s == "" { 8 return "" 9 } 10 a := []rune(s) 11 a[0] = unicode.ToLower(a[0]) 12 return string(a) 13 } 14 15 // ToUpperInitial converts a string's first character to upper case. 16 func ToUpperInitial(s string) string { 17 if s == "" { 18 return "" 19 } 20 a := []rune(s) 21 a[0] = unicode.ToUpper(a[0]) 22 return string(a) 23 } 24