Documentation ¶
Overview ¶
Package stringtool provides string utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cat ¶
Cat concatenates strings. It is intended to used in the core executing path for performance optimization. fmt.Printf is still recommended for readability.
func DeleteStrInSlice ¶
DeleteStrInSlice deletes the matched string in the slice.
func IsAllEmpty ¶
IsAllEmpty returns whether all strings are empty.
func IsAnyEmpty ¶
IsAnyEmpty returns whether any string is empty.
func StrInSlice ¶
StrInSlice returns whether the string is in the slice.
Types ¶
type StringMatcher ¶
type StringMatcher struct { Exact string `json:"exact,omitempty"` Prefix string `json:"prefix,omitempty"` RegEx string `json:"regex,omitempty" jsonschema:"format=regexp"` Empty bool `json:"empty,omitempty"` // contains filtered or unexported fields }
StringMatcher defines the match rule of a string
func (*StringMatcher) Match ¶
func (sm *StringMatcher) Match(value string) bool
Match matches a string.
func (*StringMatcher) MatchAny ¶
func (sm *StringMatcher) MatchAny(values []string) bool
MatchAny return true if any of the values matches.
func (*StringMatcher) Validate ¶
func (sm *StringMatcher) Validate() error
Validate validates the StringMatcher.
Click to show internal directories.
Click to hide internal directories.