Slice

package
v0.5.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2022 License: BSL-1.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

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

func RandomStrings added in v0.5.9

func RandomStrings(length int) []string

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

func RandomStringsLen(lenSlice, lenString int) []string

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"]

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL