mirror of
https://github.com/stashapp/stash.git
synced 2025-12-19 14:53:01 +01:00
24 lines
428 B
Go
24 lines
428 B
Go
package name
|
|
|
|
import "unicode"
|
|
|
|
// Char returns the first letter, lowered
|
|
// "" = "x"
|
|
// "foo" = "f"
|
|
// "123d456" = "d"
|
|
func Char(s string) string {
|
|
return New(s).Char().String()
|
|
}
|
|
|
|
// Char returns the first letter, lowered
|
|
// "" = "x"
|
|
// "foo" = "f"
|
|
// "123d456" = "d"
|
|
func (i Ident) Char() Ident {
|
|
for _, c := range i.Original {
|
|
if unicode.IsLetter(c) {
|
|
return New(string(unicode.ToLower(c)))
|
|
}
|
|
}
|
|
return New("x")
|
|
}
|