Documentation ¶
Index ¶
- Variables
- func Contains(list []string, str string) bool
- func Filter(s string, filter func(r rune) bool) string
- func FirstN(s string, n int, ellipsis ...string) string
- func HasEmpty(args ...string) bool
- func IntSliceToString(slices []int) string
- func IntStringToSlice(si string) []int
- func Join(sep byte, elem ...string) string
- func NotEmpty(args ...string) bool
- func Rand() string
- func RandId() string
- func RandomN(n int) string
- func RandomNumberN(length int) string
- func Remove(strings []string, strs ...string) []string
- func Reverse(s string) string
- func Seed(seed int64)
- func Substr(str string, start, stop int) (string, error)
- func TakeOne(valid, or string) string
- func TakeWithPriority(fns ...func() string) string
- func ToCamelCase(s string) string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidStartPosition is an error that indicates the start position is invalid. ErrInvalidStartPosition = fmt.Errorf("start position is invalid") // ErrInvalidStopPosition is an error that indicates the stop position is invalid. ErrInvalidStopPosition = fmt.Errorf("stop position is invalid") )
View Source
var (
IntSliceSymbol = ","
)
Functions ¶
func IntSliceToString ¶
IntSliceToString []int{1,2,3}=>1,2,3
func IntStringToSlice ¶
IntStringToSlice 字符转int切片 1,2,3=>[]int{1,2,3}
func Join ¶
Join joins any number of elements into a single string, separating them with given sep. Empty elements are ignored. However, if the argument list is empty or all its elements are empty, Join returns an empty string.
func RandomNumberN ¶
func Substr ¶
Substr returns runes between start and stop [start, stop) regardless of the chars are ascii or utf8.
func TakeWithPriority ¶
TakeWithPriority returns the first not empty result from fns.
func ToCamelCase ¶
ToCamelCase returns the string that converts the first letter to lowercase.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.