Documentation ¶
Index ¶
- func All(vs []string, f func(string) bool) bool
- func Any(vs []string, f func(string) bool) bool
- func AppendUnique(slice []string, elems ...string) (sl []string, appended int)
- func Filter(vs []string, f func(string) bool) []string
- func Fmt(format string, a ...interface{}) string
- func FmtW(w io.Writer, format string, a ...interface{}) (int, error)
- func Includes(vs []string, t string) bool
- func Index(vs []string, t string) int
- func IsEmpty(s string) bool
- func IsNotEmpty(s string) bool
- func MakeUnique(slice []string) []string
- func Map(vs []string, f func(string) string) []string
- func RandomString(length int) string
- func RandomStringCharSet(length int, charset string) string
- func Remove(slice []string, s string) (newitems []string, removed int)
- func SplitLines(s string) []string
- func SplitLinesN(s string, n int) []string
- type Pair
- type StringSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendUnique ¶
AppendUnique appends the string to the array if its not existing. The bool indicates if an append occurred.
func Filter ¶
Filter returns a new slice containing all strings in the slice that satisfy the predicate `f`.
func IsNotEmpty ¶
IsNotEmpty returns `true` if the string is not empty.
func MakeUnique ¶
MakeUnique makes the slice containing only unique items. This function does pertain the order!
func Map ¶
Map returns a new slice containing the results of applying the function `f` to each string in the original slice.
func RandomString ¶
RandomString generates a random string of length `length`.
func RandomStringCharSet ¶
RandomStringCharSet generates a random string of length `length` with the charset `charset`.
func Remove ¶
Remove removes all occurrences from the slice. The int indicates if a remove occurred.
func SplitLines ¶
SplitLines splits a string into an array of strings.
func SplitLinesN ¶
SplitLinesN splits a string into an array of `n` strings + a remainder.