str

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendUniq

func AppendUniq(slice []string, i string) []string

AppendUniq append string to slice if it its not there yet

func CaseInsensitiveContains

func CaseInsensitiveContains(s, substr string) bool

CaseInsensitiveContains perform case-insensitive search of substr in s

func CsvToSlice

func CsvToSlice(s string) []string

CsvToSlice convert s to []string; where s is in the form of string, string, string

func IsInCSVList

func IsInCSVList(s string, term string) (found bool)

IsInCSVList find term in s, where s is in the form of "string, string,string ..."

func RefToDigit

func RefToDigit(v string) (ret int64, ok bool)

RefToDigit convert references in rules like :1 :2 :3 to 1 2 3

func RemoveDuplicatesUnordered added in v0.1.12

func RemoveDuplicatesUnordered(elements []string) []string

RemoveDuplicatesUnordered remove duplicates from elements

func RemoveElementUnlessEmpty added in v0.25.0

func RemoveElementUnlessEmpty(slice []string, target string) []string

RemoveElementUnlessEmpty remove string element from slice unless doing so will result in an empty slice. This assumes entries in slice are uniq.

func TimeStampToUnix

func TimeStampToUnix(s string) (int64, error)

TimeStampToUnix converts s in RFC3339 format to epoch

func TrimLeftChar added in v0.31.0

func TrimLeftChar(s string) string

TrimLeftChar remove the first char in string and trim any whitespaces from the result

func UniqStringSlice added in v0.1.12

func UniqStringSlice(cslist string) (result []string)

UniqStringSlice removes duplicate from a comma separated list into result slice

Types

This section is empty.

Jump to

Keyboard shortcuts

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