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 ContainsAnyI(s string, ss ...string) bool
- func EqualFoldAny(s string, ss ...string) bool
- func HasPrefixAny(s string, prefixes ...string) bool
- func HasPrefixAnyI(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 IndexAny(s string, seps ...string) (int, string)
- func IndexAt(s, sep string, n int) int
- func IsCTRLC(s string) bool
- func IsPrintable(s string) bool
- 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 if s contains any specified substring.
func ContainsAnyI ¶ added in v0.0.17
ContainsAnyI returns true if s contains any specified substring (case-insensitive).
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 HasPrefixAnyI ¶ added in v0.0.52
HasPrefixAnyI is case insensitive HasPrefixAny
func HasSuffixAny ¶
HasSuffixAny checks if the string ends with any specified suffix
func IndexAny ¶ added in v0.0.22
IndexAny returns the index of the first instance of any of the specified substrings in s, or -1 if s does not contain any of the substrings.
func IsPrintable ¶ added in v0.0.17
IsPrintable checks if the strings is made only of printable characters
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 ¶ added in v0.0.4
func LongestRepeatingSequence ¶ added in v0.0.4
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, }