stringer

package
v1.0.31 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UppercaseLetters  = []rune{}
	LowercaseLetters  = []rune{}
	Letters           = []rune{}
	Numbers           = []rune{}
	LettersAndNumbers = []rune{}
	Symbols           = []rune{}
	VisibleCharacters = []rune{}
)

Functions

func AsString

func AsString(item fmt.Stringer) string

func AsStrings

func AsStrings(items ...fmt.Stringer) []string

func Capitalize

func Capitalize[T ~string](s T) string

func Chunk added in v1.0.31

func Chunk[T ~string](size int, s T) []string

func Contains

func Contains[T ~string, S ~string](s S, substr T) bool

func ContainsAny

func ContainsAny[T ~string, S ~string](s S, items ...T) bool

func ContainsAnyIgnoreCase

func ContainsAnyIgnoreCase[T ~string, S ~string](s S, items ...T) bool

func ContainsIgnoreCase added in v1.0.31

func ContainsIgnoreCase[T ~string, S ~string](s S, substr T) bool

func ContainsNone

func ContainsNone[T ~string, S ~string](s S, items ...T) bool

func ContainsNoneIgnoreCase

func ContainsNoneIgnoreCase[T ~string, S ~string](s S, items ...T) bool

func EndsWith

func EndsWith[T ~string, U ~string](s T, prefix U) bool

func Equal

func Equal[T ~string](s T, v string) bool

func EqualFold

func EqualFold[T ~string](s T, v string) bool

func EqualIgnoreCase

func EqualIgnoreCase[T ~string](s T, v string) bool

func FindNonEmpty added in v1.0.26

func FindNonEmpty[T ~string](items ...T) (T, bool)

func FindNonZero

func FindNonZero[T ~string](items ...T) (T, bool)

func HasPrefix

func HasPrefix[T ~string, U ~string](s T, prefix U) bool

func HasSuffx

func HasSuffx[T ~string, U ~string](s T, prefix U) bool

func IsDefined added in v1.0.31

func IsDefined[T ~string](s T) bool

func IsEmpty

func IsEmpty[T ~string](s T) bool

func IsLetters

func IsLetters(s string) bool

func IsLettersAndNumbers

func IsLettersAndNumbers(s string) bool

func IsLowercaseLetters

func IsLowercaseLetters(s string) bool

func IsNumbers

func IsNumbers(s string) bool

func IsUppercaseLetters

func IsUppercaseLetters(s string) bool

func IsVisibleCharacters

func IsVisibleCharacters(s string) bool

func IsZero

func IsZero[T ~string](s T) bool

func Join

func Join[T ~string](sep string, items ...T) string

func Lowercase

func Lowercase[T ~string](s T) string

func LowercaseFirst

func LowercaseFirst[T ~string](s T) string

func Remove

func Remove[T ~string, U ~string](s T, remove U) string

func RemoveLetters added in v1.0.29

func RemoveLetters[T ~string](s T) string

func RemoveNewlines added in v1.0.31

func RemoveNewlines[T ~string](s T) string

func RemoveNonLanguageCharacters added in v1.0.29

func RemoveNonLanguageCharacters[T ~string](s T, startsWithNumber T) string

func RemoveNonLetters added in v1.0.29

func RemoveNonLetters[T ~string](s T) string

func RemoveNonNumbers added in v1.0.29

func RemoveNonNumbers[T ~string](s T) string

func RemoveNonWord added in v1.0.29

func RemoveNonWord[T ~string](s T) string

func RemoveNumbers added in v1.0.29

func RemoveNumbers[T ~string](s T) string

func RemoveSpace added in v1.0.29

func RemoveSpace[T ~string](s T) string

func RemoveSpaces added in v1.0.31

func RemoveSpaces[T ~string](s T) string

func RemoveSymbols added in v1.0.29

func RemoveSymbols[T ~string](s T) string

func Replace

func Replace[T ~string, U ~string, V ~string](s T, old U, new V) string

func ReplaceInList

func ReplaceInList[T ~string](s T, olds []string, new string) string

func ReplaceLetters

func ReplaceLetters[T ~string](s T, replacement string) string

func ReplaceNewlines added in v1.0.31

func ReplaceNewlines[T ~string](s T, replacement string) string

func ReplaceNonLanguageCharacters added in v1.0.29

func ReplaceNonLanguageCharacters[T ~string](s T, replacement T, startsWithNumber T) string

func ReplaceNonLetters

func ReplaceNonLetters[T ~string](s T, replacement string) string

func ReplaceNonNumbers

func ReplaceNonNumbers[T ~string](s T, replacement string) string

func ReplaceNonWord

func ReplaceNonWord[T ~string](s T, replacement string) string

func ReplaceNumbers

func ReplaceNumbers[T ~string](s T, replacement string) string

func ReplaceSpace added in v1.0.29

func ReplaceSpace[T ~string](s T, replacement string) string

func ReplaceSpaces added in v1.0.31

func ReplaceSpaces[T ~string](s T, replacement string) string

func ReplaceSymbols

func ReplaceSymbols[T ~string](s T, replacement string) string

func Reverse

func Reverse[T ~string](s T) string

func Split

func Split[T ~string](s T, sep string) []string

func SplitAny

func SplitAny[T ~string](s T, items ...string) []string

func SplitFn

func SplitFn[T ~string](s T, fn func(string) bool) []string

func StartsWith

func StartsWith[T ~string, U ~string](s T, prefix U) bool

func Title

func Title[T ~string](s T) string

func ToLower

func ToLower[T ~string](s T) string

func ToLowerFirst

func ToLowerFirst[T ~string](s T) string

func ToUpper

func ToUpper[T ~string](s T) string

func ToUpperFirst

func ToUpperFirst[T ~string](s T) string

func Trim

func Trim[T ~string](s T, set string) T

func TrimFunc

func TrimFunc[T ~string](s T, fn func(rune) bool) T

func TrimFuncLeft

func TrimFuncLeft[T ~string](s T, fn func(rune) bool) T

func TrimFuncRight

func TrimFuncRight[T ~string](s T, fn func(rune) bool) T

func TrimLeft

func TrimLeft[T ~string](s T, set string) T

func TrimPrefix

func TrimPrefix[T ~string](s T, prefix string) T

func TrimRight

func TrimRight[T ~string](s T, set string) T

func TrimRunes

func TrimRunes[T ~string](s T, set ...rune) T

func TrimRunesLeft

func TrimRunesLeft[T ~string](s T, set ...rune) T

func TrimRunesRight

func TrimRunesRight[T ~string](s T, set ...rune) T

func TrimSpace

func TrimSpace[T ~string](s T) T

func TrimSpaceLeft

func TrimSpaceLeft[T ~string](s T) T

func TrimSpaceRight

func TrimSpaceRight[T ~string](s T) T

func TrimSuffix

func TrimSuffix[T ~string](s T, suffix string) T

func TruncateBegin

func TruncateBegin[T ~string](s T, w int) string

func TruncateBeginWith

func TruncateBeginWith[T ~string](s T, w int, m string) string

func TruncateEnd

func TruncateEnd[T ~string](s T, w int) string

func TruncateEndWith

func TruncateEndWith[T ~string](s T, w int, m string) string

func Uppercase

func Uppercase[T ~string](s T) string

func UppercaseFirst

func UppercaseFirst[T ~string](s T) string

Types

type Builder

type Builder[T ~string] struct {
	strings.Builder
}

func (*Builder[T]) WriteString

func (t *Builder[T]) WriteString(s T) (int, error)

Jump to

Keyboard shortcuts

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