Documentation
¶
Index ¶
- func ContainsFn[T any](slice []T, value T, predicate func(got, want T) bool) bool
- func IsSnakeCase(s string) bool
- func KebabCase(s string) string
- func LowerCamelCase(input string) string
- func ReplaceNonAlphanumeric(s string, replacement string) string
- func SnakeCase(s string) string
- func Split(input string, noSplit ...string) []string
- func SplitAndKeepDelimiters(input string) []string
- func SplitByNonAlphanumeric(input string) []string
- func ToPascalCase(input string) string
- func ToSnakeCase(input string) string
- func UpperCamelCase(input string) string
- func UpperKebabCase(s string) string
- func UpperSnakeCase(s string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsFn ¶ added in v1.1.29
func IsSnakeCase ¶ added in v1.1.33
IsSnakeCase 判断字符串是否为 `snake_case`,规则: - 非空 - 不能以下划线开头或结尾 - 不能包含大写字母 - 不允许连续下划线 - 仅允许小写字母、数字和下划线
func LowerCamelCase ¶ added in v1.1.29
func ReplaceNonAlphanumeric ¶ added in v1.1.29
func Split ¶ added in v1.1.29
Split reads v treating it as a "CamelCase" and returns the different words. If v isn't a valid UTF-8 string, or when v is an empty string, a slice with one element (v) is returned. Each word in noSplit (if provided) is treated as a word that shouldn't be split.
func SplitAndKeepDelimiters ¶ added in v1.1.29
func SplitByNonAlphanumeric ¶ added in v1.1.29
func ToPascalCase ¶
ToPascalCase 把字符转换为 帕斯卡命名/大驼峰命名法(CamelCase)
func UpperCamelCase ¶ added in v1.1.29
func UpperKebabCase ¶ added in v1.1.29
func UpperSnakeCase ¶ added in v1.1.29
UpperSnakeCase 把字符转换为 大写蛇形命名法(UPPER_SNAKE_CASE)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.