Documentation ¶
Index ¶
- Variables
- func After(value string, a string) (string, error)
- func Before(value string, a string) (string, error)
- func Between(value string, a string, b string) (string, error)
- func ContainsAny(s string, ss ...string) bool
- func EqualFoldAny(s string, ss ...string) bool
- func HasPrefixAny(s string, prefixes ...string) bool
- func HasPrefixI(s, prefix string) bool
- func HasSuffixAny(s string, suffixes ...string) bool
- func HasSuffixI(s, suffix string) bool
- func IndexAt(s, sep string, n int) int
- func Join(elems []interface{}, sep string) string
- func Normalize(data string) string
- func NormalizeWithOptions(data string, options NormalizeOptions) string
- func ReplaceAll(s, new string, olds ...string) string
- func Reverse(s string) string
- func SlideWithLength(s string, l int) chan string
- func SplitAny(s string, seps ...string) []string
- func TrimPrefixAny(s string, prefixes ...string) string
- func TrimSuffixAny(s string, suffixes ...string) string
- func Truncate(data string, maxSize int) string
- type EncodingType
- type LongestSequence
- type NormalizeOptions
Constants ¶
This section is empty.
Variables ¶
var HTMLPolicy *bluemonday.Policy = bluemonday.StrictPolicy()
Functions ¶
func After ¶
After extracts the string after a from value returns value as is and error if a is not found
func Before ¶
Before extracts the string before a from value returns value as is and error if a is not found
func Between ¶
Between extracts the string between a and b returns value as is and error if a or b are not found
func ContainsAny ¶
ContainsAny returns true is s contains any specified substring
func EqualFoldAny ¶
EqualFoldAny returns true if s is equal to any specified substring
func HasPrefixAny ¶
HasPrefixAny checks if the string starts with any specified prefix
func HasSuffixAny ¶
HasSuffixAny checks if the string ends with any specified suffix
func Join ¶
Join concatenates the elements of its first argument to create a single string. The separator string sep is placed between elements in the resulting string.
func NormalizeWithOptions ¶
func NormalizeWithOptions(data string, options NormalizeOptions) string
func ReplaceAll ¶
ReplaceAll returns a copy of the string s with all instances of old incrementally replaced by new.
func SlideWithLength ¶
SlideWithLength returns all the strings of the specified length while moving forward the extraction window
func TrimPrefixAny ¶
TrimPrefixAny trims all prefixes from string in order
func TrimSuffixAny ¶
TrimSuffixAny trims all suffixes from string in order
Types ¶
type EncodingType ¶
type EncodingType uint8
const ( Unknown EncodingType = iota UTF8 UTF16BE UTF16LE UTF32BE UTF32LE ISO85591 ISO88592 ISO88595 ISO88596 ISO88597 ISO88598 Windows1251 Windows1256 KOI8R ShiftJIS GB18030 EUCJP EUCKR Big5 ISO2022JP ISO2022KR ISO2022CN IBM424rtl IBM424ltr IBM420rtl IBM420ltr )
func DetectEncodingType ¶
func DetectEncodingType(data interface{}) (EncodingType, error)
type LongestSequence ¶
func LongestRepeatingSequence ¶
func LongestRepeatingSequence(s string) LongestSequence
LongestRepeatingSequence finds the longest repeating non-overlapping sequence in a string
type NormalizeOptions ¶
var DefaultNormalizeOptions NormalizeOptions = NormalizeOptions{ TrimSpaces: true, StripHTML: true, }