string

package
v0.0.0-...-a7b7215 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendToCommaSeparatedString

func AppendToCommaSeparatedString(commaSeparated string, s string) string

AppendToCommaSeparatedString appends a string to a comma separated list. It first checks that the entry is not already part of the comma separated list. commaSeparated is the comma separated string to append into. May be empty. s is the string to add. Returns the updated comma separated string

func AreSlicesEqualWithoutOrder

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

compareSlices compares 2 string slices after sorting

func CommaSeparatedStringContains

func CommaSeparatedStringContains(commaSeparated string, s string) bool

CommaSeparatedStringContains checks for a string in a comma separated list of strings commaSeparated is the comma separated string to search. May be nil. s is the string to search for. Returns true if the string is found and false otherwise.

func RemoveFromCommaSeparatedString

func RemoveFromCommaSeparatedString(commaSeparated string, s string) string

RemoveFromCommaSeparatedString removes a string from a comma separated list. It first checks that the entry is not already part of the comma separated list. commaSeparated is the comma separated list to remove from. May be empty. s is the string to remove. Returns the updated comma separated string

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