Documentation ¶
Index ¶
- func FromString(s string, sep string) []string
- func StrAppendUnique(vs []string, toAdd string) []string
- func StrAppendUniques(vs []string, toAdd []string) []string
- func StrDelete(vs []string, toDel string) []string
- func StrExclude(vs []string, toExclude []string) []string
- func StrFilter(vs []string, f func(string) bool) []string
- func StrInclude(vs []string, t string) bool
- func StrIndex(vs []string, t string) int
- func StrMap(vs []string, f func(string) string) []string
- func StrUnique(vs []string) []string
- func StringSliceToIntSlice(ss []string) ([]int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromString ¶ added in v0.19.0
FromString converts a string to a slice of strings, splitting on the sep character. Unlike strings.Split, this function will also trim whitespace from the resulting strings.
func StrAppendUnique ¶
StrAppendUnique appends toAdd to the vs string slice if toAdd does not already exist in the slice. It returns the new or unchanged string slice.
func StrAppendUniques ¶
StrAppendUniques appends a slice of string values to the vs string slice. It only appends values that do not already exist in the slice. It returns the new or unchanged string slice.
func StrExclude ¶ added in v0.19.0
StrExclude removes all instances of any value in toExclude from the vs string slice. It returns the new or unchanged string slice.
func StrInclude ¶
func StringSliceToIntSlice ¶
StringSliceToIntSlice converts a slice of strings to a slice of ints. Returns an error if any values cannot be parsed.
Types ¶
This section is empty.