Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains
deprecated
func Contains[T comparable](s []T, e T) bool
Contains searches for an element in a slice and returns true if found Source: https://stackoverflow.com/a/70802740/5516320
Deprecated: As of Go 1.21, you can use the stdlib slices package, which was promoted from the experimental package: https://stackoverflow.com/a/71181131/5516320
This makes this function redundant, instead use slices.Contains()
func RandomStrings ¶ added in v0.5.9
RandomStrings generates a slice of random strings with the given length. The strings are generated by Str.Random. The length of each string is increasing by (i+1/2) with i being the passed length.
func RandomStringsLen ¶ added in v0.5.9
RandomStringsLen generates a slice of strings with the given length lenSlice. The strings are generated by Str.Random. The length of each string is defined by the passed lenString. This makes it possible to generate a slice of letters: Example: RandomStringsLen(5, 1) -> ["a", "c", "e", "g", "i"] or a slice of strings with the same length: Example: RandomStringsLen(5, 3) -> ["gea", "brv", "pgd", "qwo", "cie"]
func RemoveElement ¶ added in v0.6.0
func RemoveElement[T comparable](s []T, e T) []T
func RemoveIndex ¶ added in v0.6.0
func RemoveIndex[T comparable](s []T, idx int) []T
Types ¶
This section is empty.