stringutil

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: Apache-2.0 Imports: 1 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 FirstNotEmpty added in v1.1.0

func FirstNotEmpty(values ...string) string

func SplitWithEscape

func SplitWithEscape(s string, split uint8, escape uint8, trim bool) []string

SplitWithEscape behaves like strings.Split but supports defining an escape character. E.g, when using ',' as split separator and '\' es escape code, the string "1\,2,3," will not be split into ["1, 2", "3"].

func StringOrDefault

func StringOrDefault(val string, defaultStr string) string

Types

type StringSet

type StringSet map[string]struct{}

func NewStringSet added in v1.1.0

func NewStringSet(values []string) StringSet

func (*StringSet) Add

func (s *StringSet) Add(v string)

func (StringSet) Contains

func (s StringSet) Contains(v string) bool

func (StringSet) Keys

func (s StringSet) Keys() []string

Jump to

Keyboard shortcuts

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