Documentation
¶
Overview ¶
Package strings contains utilities for working with strings in Go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TruncateUTF8 ¶
TruncateUTF8 truncates the given string to make sure it uses less than limit bytes. If the last code point is an utf8 code point that would be split, it removes it entirely to make sure the resulting string is not broken.
This function may still split characters that are comprised of more than one valid utf8 code point, like many emoji, however the resulting string will still be valid utf8. Example: The "Flag: United States emoji" is a flag sequence combining
🇺 Regional Indicator Symbol Letter U 🇸 Regional Indicator Symbol Letter S
Types ¶
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher test a string for match against a list of strings. See `NewMatcher` for details.
func NewMatcher ¶
NewMatcher creates a new strings matcher. Use `matchPrefix` to create a prefixes matcher.