Documentation
¶
Index ¶
- func InArray(needle string, haystack []string) bool
- func Is(pattern, value string) bool
- func Md5(s string) string
- func RandomString(length int) string
- func StrShuffle(s string) string
- func Strpos(haystack, needle string) int
- func Strrev(s string) string
- func Strrpos(haystack, needle string) int
- func Strtr(s, from, to string) string
- type AtoiRes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InArray ¶
InArray checks if a string is in a string array.
Example:
InArray("abc", []string{"abc", "def"}) // true
func Is ¶
Is returns true if the value matches the pattern. The pattern can contain the wildcard character *.
Example:
Is("*.example.com", "www.example.com") // true Is("*.example.com", "example.com") // false
func Md5 ¶
Md5 returns the md5 hash of a string.
Example:
Md5("abc") // 900150983cd24fb0d6963f7d28e17f72
func RandomString ¶
RandomString returns a random string with the specified length.
Example:
RandomString(10) // "qujrlkhyqr"
func StrShuffle ¶
StrShuffle returns a string with its characters in random order.
Example:
StrShuffle("abc") // "bca"
func Strpos ¶
Strpos returns the position of the first occurrence of a substring in a string.
Example:
Strpos("abc", "b") // 1
func Strrev ¶
Strrev returns a string with its characters in reverse order.
Example:
Strrev("abc") // "cba"
Types ¶
Click to show internal directories.
Click to hide internal directories.