stringutil

package
v1.12.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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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