stringutil

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CapitaliseFirstLetter

func CapitaliseFirstLetter(s string) string

func CombineUnique

func CombineUnique(originals []string, candidates []string) []string

CombineUnique returns the unique union of originals and candidates

func Contains

func Contains(entries []string, searchTerm string) bool

func ContainsPrefix

func ContainsPrefix(entries []string, searchTerm string) bool

func GetFirstNonEmpty

func GetFirstNonEmpty(candidates ...string) string

func GetMatchingSuffix

func GetMatchingSuffix(entry string, suffixes []string) string

GetMatchingSuffix checks if entry has at least one of the given suffixes. If a suffix matches, it is returned, otherwise an empty string is returned.

func Sha1hash

func Sha1hash(input []byte) string

Sha1hash returns a SHA1 checksum of the given input string. This *must not* be used for cryptographic purposes, as SHA1 is not secure.

func Sha1hashString

func Sha1hashString(input string) string

Sha1hashString returns a SHA1 checksum of the given input string. This *must not* be used for cryptographic purposes, as SHA1 is not secure.

func ToBool

func ToBool(input string) bool

func ToBoolWithDefault

func ToBoolWithDefault(input string, defaultValue bool) bool

func Unique

func Unique(candidates []string) []string

Unique returns the unique elements from the slice

Types

This section is empty.

Jump to

Keyboard shortcuts

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