mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-24 01:30:25 +08:00
20 lines
243 B
Go
20 lines
243 B
Go
package util
|
|
|
|
import "strings"
|
|
|
|
func Title(s string) string {
|
|
if len(s) == 0 {
|
|
return s
|
|
}
|
|
|
|
return strings.ToUpper(s[:1]) + s[1:]
|
|
}
|
|
|
|
func Untitle(s string) string {
|
|
if len(s) == 0 {
|
|
return s
|
|
}
|
|
|
|
return strings.ToLower(s[:1]) + s[1:]
|
|
}
|