stringutil

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OptionsMapToSlice

func OptionsMapToSlice(optionsMap map[string]string) []string

OptionsMapToSlice transforms a map to a slice of strings under the key=value format.

func ParseOptions

func ParseOptions(input string) []string

ParseOptions parses a string containing options in various formats Returns a slice of strings where each string represents an option.

func PathRemoveSpecialCharacter added in v0.0.2

func PathRemoveSpecialCharacter(path string) string

PathRemoveSpecialCharacter adds a slash before a special character

func SliceContainsItem

func SliceContainsItem(slice []string, item string) bool

SliceContainsItem checks if an item is present in a slice of strings. True if the item is found, otherwise false.

func SliceDifference

func SliceDifference(slice1, slice2 []string) []string

SliceDifference returns the elements in `slice1` that are not present in `slice2`.

func SliceRemoveDuplicates

func SliceRemoveDuplicates(slice []string) []string

SliceRemoveDuplicates returns a slice with all duplicates removed.

func SliceRemoveValue

func SliceRemoveValue(slice []string, value string) []string

SliceRemoveValue returns the slice with the specified value removed.

func SliceToArgsFormat

func SliceToArgsFormat(arr []string) string

SliceToArgsFormat converts a slice of strings into a string with elements separated by '|'.

func SliceToMap

func SliceToMap(slice []string) map[string]struct{}

SliceToMap creates a map from a slice of strings for faster lookup.

func Split

func Split(input string) []string

Split splits a string into a slice of strings based on space characters.

func SplitPath

func SplitPath(path string) []string

SplitPath splits a filepath into its individual elements.

Types

This section is empty.

Jump to

Keyboard shortcuts

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