Documentation ¶
Overview ¶
strings的扩展包,也包括字符串slice和set功能。
Index ¶
- func Btoi(b bool) int
- func CamelToSnake(s string) string
- func CheckPhone(s string) bool
- func GetMapValue(m map[string]string, key string, caseInsensitive bool) string
- func GetNotSpace(s ...string) string
- func GetSuffix(s string) string
- func Hello(name, lang string) (string, error)
- func I64SliceContains(a []int64, s int64) bool
- func I64SliceIndexOf(a []int64, s int64) int
- func ISliceContains(a []int, s int) bool
- func ISliceIndexOf(a []int, s int) int
- func Itob(i int) bool
- func MapKeyToLower(m map[string]string)
- func RemovePrefix(s, prefix string) string
- func RemoveSuffix(s, suffix string) string
- func RemoveSymbol(s, symbol string) string
- func SliceAsSetEqual(a1 []string, a2 []string) bool
- func SliceClone(a []string) []string
- func SliceContains(a []string, s string) bool
- func SliceContainsCase(a []string, s string, caseInsensitive bool) bool
- func SliceEqual(a1 []string, a2 []string) bool
- func SliceFilter(a []string, target []string, filter func(s string) bool) []string
- func SliceFlatten(al ...[]string) []string
- func SliceIndexOf(a []string, s string) int
- func SliceInt64Unique(a []int64) []int64
- func SliceMap(a []string, f func(s string) string) []string
- func SliceRemoveIndex(s []string, index int) []string
- func SliceToLower(a []string)
- func SliceUnique(a []string) []string
- func SnakeToCamel(s string) string
- func Strtof(s string) float64
- func Strtoi(s string) int
- type Set
- func (set *Set) Add(elems ...string)
- func (set *Set) Del(elems ...string)
- func (set *Set) Each(f func(elem string))
- func (set *Set) Elems() []string
- func (set *Set) Has(elem string) bool
- func (set *Set) HasAll(elems ...string) bool
- func (set *Set) HasOne(elems ...string) bool
- func (set *Set) Size() int
- func (set Set) String() string
- func (set *Set) Union(others ...Set)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CamelToSnake ¶
CamelToSnake converts a given string to snake case
func CheckPhone ¶
func GetMapValue ¶
returns the value of the map for a certain key. Ignore case when comparing if case insensitive.
func GetNotSpace ¶
func I64SliceContains ¶
func I64SliceIndexOf ¶
func ISliceContains ¶
func ISliceIndexOf ¶
func MapKeyToLower ¶
transforms each item of a map to lowercase.
func RemovePrefix ¶
func RemoveSuffix ¶
func RemoveSymbol ¶
func SliceAsSetEqual ¶
func SliceClone ¶
func SliceContains ¶
func SliceEqual ¶
func SliceFilter ¶
func SliceFlatten ¶
func SliceIndexOf ¶
func SliceInt64Unique ¶
func SliceRemoveIndex ¶
func SliceUnique ¶
func SnakeToCamel ¶
SnakeToCamel returns a string converted from snake case to uppercase
Types ¶
Click to show internal directories.
Click to hide internal directories.