UpperFirstLowerRest title cases the first rune and lower cases the rest of s
(caser Caser, s string)
| 249 | |
| 250 | // UpperFirstLowerRest title cases the first rune and lower cases the rest of s |
| 251 | func UpperFirstLowerRest(caser Caser, s string) string { |
| 252 | caser = CaserOrDefault(caser) |
| 253 | if len(s) == 0 { |
| 254 | return "" |
| 255 | } |
| 256 | b := strings.Builder{} |
| 257 | b.Grow(len(s)) |
| 258 | for i, r := range s { |
| 259 | if i == 0 { |
| 260 | b.WriteRune(caser.ToTitle(r)) |
| 261 | } else { |
| 262 | b.WriteRune(caser.ToLower(r)) |
| 263 | } |
| 264 | } |
| 265 | return b.String() |
| 266 | } |
| 267 | |
| 268 | // UpperFirst title cases the first rune of s |
| 269 | func UpperFirst(caser Caser, s string) string { |
searching dependent graphs…