strhelper

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(s []string, e string) bool

Contains check if string exists in given slice

func Filter

func Filter(s []string, predicate func(string) bool) []string

Filter applies a given predicate function to each element of s. If the predicate is satisfied the element gets added to the result slice.

func IsEmptyOrNil added in v0.1.1

func IsEmptyOrNil(str *string) bool

IsEmptyOrNil returns whether str is empty or nil

func MergeMapString added in v0.0.15

func MergeMapString(m1, m2 map[string]string) map[string]string

MergeMapString merge two maps in a new one

Types

type Set added in v0.0.10

type Set map[string]bool

Set represents a set of strings

func NewSet added in v0.0.10

func NewSet() Set

NewSet initializes and returns a new Set

func (Set) Add added in v0.0.10

func (ss Set) Add(s string)

Add ensures a given string is part of the Set

func (Set) Contains added in v0.0.10

func (ss Set) Contains(s string) bool

Contains returns whether s is part of the Set

func (Set) ToSlice added in v0.0.10

func (ss Set) ToSlice() []string

ToSlice takes all elements of the set and assigns them to a []string

Jump to

Keyboard shortcuts

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