strings

package
v0.0.0-...-27647ab Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: BSD-3-Clause Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(l, r string) string

func AppendNewline

func AppendNewline(l string) string

func Dedent

func Dedent(s string) string

func IndexAllFunc

func IndexAllFunc(s string, f func(rune) bool) []int

func LastCut

func LastCut(s, sep string) (before, after string, found bool)

func MapCut

func MapCut(s string, fn StrFn, sep string) (before, after string, found bool)

func MapSplit

func MapSplit(s string, fn StrFn, sep string) []string

func NumLeadingSpaces

func NumLeadingSpaces(s string) int

func ParseNestedList

func ParseNestedList(s string, left, right, sep rune) ([]any, error)

func ScanAllLines

func ScanAllLines(r io.Reader, skipEmpty bool) ([]string, error)

func ShellQuote

func ShellQuote(s string) string

func SplitAny

func SplitAny(ds []rune, s string) []string

func SplitFunc

func SplitFunc(f func(rune) bool, s string) []string

func ToCamel

func ToCamel(s string) string

func ToSnake

func ToSnake(s string) string

func ToString

func ToString(o any) string

func ToValue

func ToValue(o any) string

func TrimCut

func TrimCut(s, cutset, sep string) (before, after string, found bool)

func TrimSpaceCut

func TrimSpaceCut(s, sep string) (before, after string, found bool)

func TrimSpaceSplit

func TrimSpaceSplit(s, sep string) []string

func TrimSplit

func TrimSplit(s, cutset, sep string) []string

Types

type Interner

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

func Intern

func Intern(ss ...string) Interner

func (Interner) Add

func (i Interner) Add(s string) string

func (Interner) Get

func (i Interner) Get(s string) string

type Secret

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

func SecretOf

func SecretOf(s string) Secret

func (Secret) String

func (s Secret) String() string

func (Secret) Value

func (s Secret) Value() string

type StrFn

type StrFn = func(string) string

func Trimmer

func Trimmer(cutset string) StrFn

Jump to

Keyboard shortcuts

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