Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Filter ¶
Filter, returns a new slice containing all strings in the slice that satisfy the predicate f. // Example:
fmt.Println(Filter(strs, func(v string) bool { return strings.Contains(v, "e") }))
func FindAll ¶
FindAll, returns true if all of the strings in the slice satisfy the predicate f. Example:
fmt.Println(FindAll(strs, func(v string) bool { return strings.HasPrefix(v, "p") }))
func FindAny ¶
FindAny, returns true if one of the strings in the slice satisfies the predicate f. Example:
fmt.Println(FindAny(strs, func(v string) bool { return strings.HasPrefix(v, "p") }))
func FirstIndex ¶
FirstIndex, returns the first index of the target string, or -1 if no match is found. Example: fmt.Println(FirstIndex(strs, "pear"))
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.