You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
243 B
Go
20 lines
243 B
Go
4 years ago
|
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:]
|
||
|
}
|