strutil

package
v0.0.0-...-28d9058 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: UPL-1.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreSlicesEqualWithoutOrder

func AreSlicesEqualWithoutOrder(slice1 []string, slice2 []string) bool

compareSlices compares 2 string slices after sorting

func RemoveStringFromSlice

func RemoveStringFromSlice(slice []string, s string) []string

RemoveStringFromSlice removes a string from a string slice. slice is the string slice to remove the string from. May be nil. s is the string to remove from the slice. Returns a new slice with the remove string removed.

func SliceAddString

func SliceAddString(slice []string, s string) ([]string, bool)

SliceAddString Adds a string to a slice if it is not already present

func SliceContainsString

func SliceContainsString(slice []string, s string) bool

SliceContainsString checks for a string in a slice of strings slice is the string slice to search. May be nil. s is the string to search for in the slice. Returns true if the string is found in the slice and false otherwise.

func SliceToSet

func SliceToSet(list []string) map[string]bool

SliceToSet converts a slice of strings to a set of strings

func TrimArray

func TrimArray(a []string) []string

func UnorderedEqual

func UnorderedEqual(mapBool map[string]bool, arrayStr []string) bool

UnorderedEqual checks if a map and array have the same string elements. The same order is not required.

Types

This section is empty.

Jump to

Keyboard shortcuts

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