Documentation
¶
Index ¶
- func MinInt(a int, b int) int
- func RuneFromIndex(w []rune, i int) string
- func RuneInIndex(w []rune, i int) string
- func RuneInRange(w []rune, from int, to int) string
- func StringFromIndex(str string, i int) string
- func StringInIndex(str string, i int) string
- func StringInRange(str string, from int, to int) string
- func StringInSlice(arr []string, i int) string
- func StringSliceInRange(arr []string, from int, to int) []string
- func StringSplit(str string) []string
- type OrderedStringCounter
- func (s *OrderedStringCounter) Add(strs []string)
- func (s *OrderedStringCounter) Count(str string) int
- func (s *OrderedStringCounter) Exists(str string) bool
- func (s *OrderedStringCounter) Items() []StringCounterItem
- func (s *OrderedStringCounter) Sum() int
- func (s *OrderedStringCounter) Total() int
- type StringCounter
- func (s *StringCounter) Add(strs []string)
- func (s *StringCounter) Count(str string) int
- func (s *StringCounter) Del(strs []string)
- func (s *StringCounter) Exists(str string) bool
- func (s *StringCounter) Iter() <-chan StringCounterItem
- func (s *StringCounter) Sum() int
- func (s *StringCounter) Total() int
- type StringCounterItem
- type StringCounterItemSlice
- type StringSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StringInRange ¶
StringInRange 从from到to截取字符串
func StringSliceInRange ¶
StringSliceInRange 获取[]string中from-to位置字符串
Types ¶
type OrderedStringCounter ¶
type OrderedStringCounter struct {
// contains filtered or unexported fields
}
OrderedStringCounter 统计str重复次数
func NewOrderedStringCounter ¶
func NewOrderedStringCounter(strs []string) *OrderedStringCounter
NewOrderedStringCounter init OrderedStringCounter instance
func (*OrderedStringCounter) Add ¶
func (s *OrderedStringCounter) Add(strs []string)
Add add strings to counter
func (*OrderedStringCounter) Count ¶
func (s *OrderedStringCounter) Count(str string) int
Count get the counter of a string
func (*OrderedStringCounter) Exists ¶
func (s *OrderedStringCounter) Exists(str string) bool
Exists check string exists in counter items or not
func (*OrderedStringCounter) Items ¶
func (s *OrderedStringCounter) Items() []StringCounterItem
func (*OrderedStringCounter) Sum ¶
func (s *OrderedStringCounter) Sum() int
Sum sum the total count of the items
func (*OrderedStringCounter) Total ¶
func (s *OrderedStringCounter) Total() int
Total total number of the items
type StringCounter ¶
type StringCounter struct {
// contains filtered or unexported fields
}
StringCounter 统计str重复次数
func NewStringCounter ¶
func NewStringCounter(strs []string) *StringCounter
NewStringCounter init StringCounter instance
func (*StringCounter) Count ¶
func (s *StringCounter) Count(str string) int
Count get the counter of a string
func (*StringCounter) Del ¶
func (s *StringCounter) Del(strs []string)
Del delete strings from counter items
func (*StringCounter) Exists ¶
func (s *StringCounter) Exists(str string) bool
Exists check string exists in counter items or not
func (*StringCounter) Iter ¶
func (s *StringCounter) Iter() <-chan StringCounterItem
Iter iterate StringCounter items
type StringCounterItem ¶
StringCounterItem used in Iter
type StringCounterItemSlice ¶
type StringCounterItemSlice []StringCounterItem
StringCounterItemSlice StringCounterItem array
func NewStringCounterItemSlice ¶
func NewStringCounterItemSlice(cap int) StringCounterItemSlice
NewStringCounterItemSlice 新建StringCounterItemSlice
func (StringCounterItemSlice) Len ¶
func (s StringCounterItemSlice) Len() int
Len implement sort.Sorter
func (StringCounterItemSlice) Less ¶
func (s StringCounterItemSlice) Less(i, j int) bool
Less implement sort.Sorter
func (StringCounterItemSlice) Swap ¶
func (s StringCounterItemSlice) Swap(i, j int)
Swap implement sort.Sorter