mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-24 18:00:24 +08:00
cecd4b1b75
* add plugin support * add plugin support * add plugin support * add plugin support * add plugin support * add plugin support * add plugin support * add plugin support * add plugin support * add plugin support * add plugin support * remove no need * add plugin support * rename * rename * add plugin support * refactor * update plugin * refactor * refactor * refactor * update plugin * newline Co-authored-by: anqiansong <anqiansong@xiaoheiban.cn>
29 lines
373 B
Go
29 lines
373 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:]
|
|
}
|
|
|
|
func Index(slice []string, item string) int {
|
|
for i, _ := range slice {
|
|
if slice[i] == item {
|
|
return i
|
|
}
|
|
}
|
|
return -1
|
|
}
|