Documentation ¶
Overview ¶
Package stringsx contains string utilities. It means to be a complement to the standard strings package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clean ¶
Clean removes non-graphic characters from the given string. Removable characters are the ones for which unicode.IsGraphic() returns false.
For details, see https://stackoverflow.com/a/58994297/1705598
func LimitRunes ¶
LimitRunes returns a slice of s that contains at most the given number of runes. If n is 0 or negative, the empty string is returned. If s has less runes than n, s is returned.
Each byte of invalid UTF-8 sequences count as one when counting the limit, e.g.
LimitRunes("\xff\xffab", 3) // returns "\xff\xffa"
func SplitQuotes ¶
SplitQuotes splits the given string by sep. If sep appears inside quotes, it is skipped. Quotes are not removed from the parts.
Types ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool implements a string pool safe for concurrent use.
For details, see https://stackoverflow.com/a/51983331/1705598