Documentation
¶
Index ¶
- func Contains(s []string, v string) int
- func ContainsIndex(s []string, substr string) int
- func ElementHasIndex(haystack []string, needle string, wantIndex int) bool
- func Index(haystack []string, needle string, equalFold bool, caser *cases.Caser) int
- func IndexMore(haystack []string, needle string, trimSpace, toLower bool, ...) int
- func IndexMulti(s string, substr ...string) int
- func IndexValueOrDefault(s []string, index int, def string) string
- func SoSFilterLinesHaveIndex(groups [][]string, needle string, wantIndex int) [][]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
Contains checks a slice of string to validate if individual string elements contain the supplied match string. A `1` is returned if all slice strings match, a `-1` is returned if no slices strings match, and a `0` is returned if more than one, but less than all slice strings match. An empty slice returns a `-1` as there are no members to match.
func ContainsIndex ¶
ContainsIndex returns the index of the first match using `strings.Contains()`. Returns -1 if not found.
func Index ¶
Index returns the index of the first match using `=`. Returns -1 if not found. if `equalFold` is selected and `caser` is `nil`, the default caser will be used.
func IndexMore ¶
func IndexMore(haystack []string, needle string, trimSpace, toLower bool, matchType stringsutil.MatchType) int
IndexMore returns the index of an element in a string slice. Returns -1 if not found.
func IndexMulti ¶
IndexMulti returns the earliest match.
func IndexValueOrDefault ¶
IndexValueOrDefault returns the element at the index provided or the default string.
Types ¶
This section is empty.