stringutil

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

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