Documentation ¶
Index ¶
- Constants
- func Bytes2String(b []byte) string
- func Compact(array []string) []string
- func Contained(arr []string, flag string) (b bool)
- func Contains(arr []string, flag string) (b bool)
- func ContainsBy(arr []string, fn func(str string) bool) (b bool)
- func ContainsChineseChar(str string) bool
- func First(array []string) string
- func HasPrefix(arr []string, prefix string) (b bool)
- func HasSuffix(arr []string, suffix string) (b bool)
- func Last(array []string) string
- func Nth(array []string, idx int) string
- func RandomAlphabet(n int) string
- func RandomAlphanumeric(n int) string
- func RandomNumber(n int) string
- func ShortID() string
- func String2Bytes(s string) []byte
Constants ¶
View Source
const ( Number = "0123456789" Alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" Alphanumeric = Alphabet + Number )
Variables ¶
This section is empty.
Functions ¶
func Bytes2String ¶ added in v1.0.0
Bytes2String more effect but not safe
func ContainsBy ¶ added in v1.0.0
ContainsBy check any element in arr by fn
func ContainsChineseChar ¶ added in v1.0.0
ContainsChineseChar check str contains chinese char
func RandomAlphabet ¶ added in v1.0.0
RandomAlphabet return a random n length string of alphabet.
func RandomAlphanumeric ¶ added in v1.0.0
RandomAlphanumeric return a random n length string of alphanumeric.
func RandomNumber ¶ added in v1.0.0
RandomNumber return a random n length string of number.
func ShortID ¶ added in v1.0.0
func ShortID() string
ShortID generate short id. Use RandomAlphanumeric(10) instead When short id generate fail.
func String2Bytes ¶ added in v1.0.0
String2Bytes more effect but not safe
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.