Documentation ¶
Index ¶
- type Set
- type Slice
- func (s Slice) Append(elems ...Str) Slice
- func (s Slice) CharSort(descending bool) Slice
- func (s Slice) Clone() Slice
- func (s Slice) Counter() map[Str]int
- func (s Slice) Deduplication() Slice
- func (s Slice) Delete(ele Str) (ns Slice, err error)
- func (s Slice) Eq(s1 Slice) bool
- func (s Slice) In(sub Str) bool
- func (s Slice) Index(start int, end int) Slice
- func (s Slice) Join(sep Str) Str
- func (s Slice) Len() int
- func (s Slice) POP() (ns Slice, ele Str)
- func (s Slice) Reverse() Slice
- func (s Slice) ToSet() Set
- func (s Slice) ToString() []string
- type Str
- func (str Str) Capitalize() Str
- func (str Str) Count(substr Str) int
- func (str Str) Digit() (int, error)
- func (str Str) EndsWith(suffix Str) bool
- func (str Str) Eq(s Str) bool
- func (str Str) Find(substr Str) int
- func (str Str) In(substr Str) bool
- func (str Str) Index(start int, end int) Str
- func (str Str) IsALNum() bool
- func (str Str) IsAlpha() bool
- func (str Str) IsLower() bool
- func (str Str) IsNumeric() bool
- func (str Str) IsSpace() bool
- func (str Str) IsUpper() bool
- func (str Str) Join(elems []string) Str
- func (str Str) LStrip(cut Str) Str
- func (str Str) Len() int
- func (str Str) Levenshtein(s Str) float64
- func (str Str) Lower() Str
- func (str Str) RStrip(cut Str) Str
- func (str Str) Replace(old, new Str) Str
- func (str Str) Runes() []rune
- func (str Str) Split(sep Str) Slice
- func (str Str) StartsWith(prefix Str) bool
- func (str Str) Strip(cut Str) Str
- func (str Str) SwapCase() Str
- func (str Str) Title() Str
- func (str Str) ToString() string
- func (str Str) TrimPrefix(prefix Str) Str
- func (str Str) TrimSpace() Str
- func (str Str) TrimSuffix(suffix Str) Str
- func (str Str) Upper() Str
- type Stringer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Set ¶
type Set map[Str]struct{}
func (Set) Intersection ¶
Intersection Get the intersection of s and s1
type Slice ¶
type Slice []Str
func (Slice) Deduplication ¶
Deduplication Remove duplicate data from string slice and return Notice: order
func (Slice) Delete ¶
Delete remove an element in Slice.
Returns err if the elements not exits in Slice or Slice.Len == 0.
type Str ¶
type Str string
func (Str) Capitalize ¶
Capitalize Convert the first letter to uppercase
func (Str) Count ¶
Count counts the number of non-overlapping instances of substr in s. If substr is an empty string, Count returns 1 + the number of Unicode code points in s.
func (Str) Find ¶
Find returns the index of the first instance of substr in s, or -1 if substr is not present in s.
func (Str) IsALNum ¶
IsALNum Returns True if the string has at least one character and all characters are letters or numbers, otherwise returns False
func (Str) IsAlpha ¶
IsAlpha Returns True if the string has at least one character and all characters are alphabets or Chinese characters, otherwise returns False
func (Str) IsLower ¶
IsLower Returns True if the string contains at least one case-sensitive character and all of those (case-sensitive) characters are lowercase, False otherwise
func (Str) IsNumeric ¶
IsNumeric Returns True if the string contains only numeric characters, otherwise returns False
func (Str) IsSpace ¶
IsSpace Returns True if the string contains only whitespace, otherwise returns False.
func (Str) IsUpper ¶
IsUpper Returns True if the string contains at least one case-sensitive character and all of those (case-sensitive) characters are uppercase, False otherwise
func (Str) Join ¶
Join concatenates the elements of its first argument to create a single string. The separator string str is placed between elements in the resulting string.
func (Str) LStrip ¶
LStrip returns a slice of the string s with all leading Unicode code points contained in cut removed.
To remove a prefix, use TrimPrefix instead.
func (Str) Levenshtein ¶
Levenshtein Fastest levenshtein implementation in Go.
this implementation is currently not thread safe, and it assumes that the runes only go up to 65535. This will be fixed soon. [Algorithm] https://github.com/ka-weihe/fast-levenshtein
func (Str) RStrip ¶
RStrip returns a slice of the string s, with all trailing Unicode code points contained in cut removed.
To remove a suffix, use TrimSuffix instead.
func (Str) Replace ¶
Replace returns a copy of the string s with all non-overlapping instances of old replaced by new. If old is empty, it matches at the beginning of the string and after each UTF-8 sequence, yielding up to k+1 replacements for a k-rune string.
func (Str) Split ¶
Split slices s into all substrings separated by sep and returns a slice of the substrings between those separators.
func (Str) StartsWith ¶
StartsWith tests whether the string s begins with prefix.
func (Str) Strip ¶
Strip returns a slice of the string s with all leading and trailing Unicode code points contained in cut removed.
func (Str) SwapCase ¶
SwapCase Convert uppercase to lowercase and lowercase to uppercase in a string
func (Str) Title ¶
Title returns a copy of the string s with all Unicode letters mapped to their Unicode title case.
func (Str) TrimPrefix ¶
TrimPrefix returns s without the provided leading prefix string. If s doesn't start with prefix, s is returned unchanged.
func (Str) TrimSpace ¶
TrimSpace returns a slice of the string s, with all leading and trailing white space removed, as defined by Unicode.
func (Str) TrimSuffix ¶
TrimSuffix returns s without the provided trailing suffix string. If s doesn't end with suffix, s is returned unchanged.