ustrings

package
v0.2.37 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConjunctionDefault      = "and"
	SeparatorDefault        = ","
	WrappersDefault         = Empty
	EmptyListMessageDefault = ""
)

Variables

This section is empty.

Functions

func OxfordizeList

func OxfordizeList(elements []string, options ...OxfordOptions) string

func ParseFlags

func ParseFlags(expression string) (map[string]string, error)

ParseFlags - convert command line flags to a map of keys to strings.

func TrimQuotes

func TrimQuotes(input string) string

TrimQuotes - given an input string, remove one layer of surrounding quotes if they exist.

func WrapString

func WrapString(input string, wrappers WrapOption) string

Types

type OxfordConfigs

type OxfordConfigs struct {
	// contains filtered or unexported fields
}

type OxfordOptions

type OxfordOptions func(config *OxfordConfigs)

func WithConjunction

func WithConjunction(conjunction string) OxfordOptions

func WithEmptyListMessage

func WithEmptyListMessage(message string) OxfordOptions

func WithInnerWrappers

func WithInnerWrappers(wrappers WrapOption) OxfordOptions

func WithOuterWrappers

func WithOuterWrappers(wrappers WrapOption) OxfordOptions

func WithSeparator

func WithSeparator(separator string) OxfordOptions

type WrapOption

type WrapOption int
const (
	Empty WrapOption = iota
	SingleQuotes
	DoubleQuotes
	TackQuotes
	Parentheses
	SquareBrackets
	AngleBrackets
)

Jump to

Keyboard shortcuts

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