str

package
v0.3.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2018 License: MIT Imports: 7 Imported by: 34

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chop added in v0.2.2

func Chop(l uint) func(str string) []string

func Contains added in v0.2.2

func Contains(substr string) func(string) bool

func EqLen added in v0.2.2

func EqLen(l uint) func(str string) bool

func HasPrefix added in v0.2.4

func HasPrefix(prefix string) func(str string) bool

func HasSuffix added in v0.2.4

func HasSuffix(suffix string) func(str string) bool

func InSet added in v0.2.2

func InSet(set []string) func(str string) bool

func Len added in v0.2.2

func Len(str string) int

func Longer added in v0.2.2

func Longer(l uint) func(str string) bool

func Match added in v0.2.2

func Match(re string) func(str string) bool

func NotContains added in v0.2.2

func NotContains(substr string) func(string) bool

func NotHasPrefix added in v0.2.4

func NotHasPrefix(prefix string) func(str string) bool

func NotHasSuffix added in v0.2.4

func NotHasSuffix(suffix string) func(str string) bool

func NotInSet added in v0.2.2

func NotInSet(set []string) func(str string) bool

func Prefix added in v0.3.0

func Prefix(prefix string) func(str string) string

func Replace added in v0.2.4

func Replace(oldStr, newStr string, n int) func(str string) string

func ReplaceTable added in v0.3.1

func ReplaceTable(replaceTable map[string]string) func(str string) string

func Shorter added in v0.2.2

func Shorter(l uint) func(str string) bool

func Split added in v0.2.4

func Split(delim string, n int) func(str string) []string

func StrictLess added in v0.2.2

func StrictLess(a, b string) bool

func Suffix added in v0.3.0

func Suffix(suffix string) func(str string) string

func TrimPrefix added in v0.2.2

func TrimPrefix(prefix string) func(str string) string

func TrimSuffix added in v0.2.2

func TrimSuffix(suffix string) func(str string) string

Types

type CountItems added in v0.3.0

type CountItems []CounterItem

func (CountItems) Copy added in v0.3.0

func (items CountItems) Copy() CountItems

func (CountItems) Counter added in v0.3.0

func (items CountItems) Counter() Counter

func (CountItems) Filter added in v0.3.0

func (items CountItems) Filter(pred func(item CounterItem) bool) CountItems

func (CountItems) Find added in v0.3.0

func (items CountItems) Find(pred func(item CounterItem) bool) (CounterItem, bool)

func (CountItems) Len added in v0.3.0

func (items CountItems) Len() int

func (CountItems) New added in v0.3.0

func (items CountItems) New() CountItems

func (CountItems) Sort added in v0.3.0

func (items CountItems) Sort() CountItems

func (CountItems) SortIncr added in v0.3.0

func (items CountItems) SortIncr() CountItems

func (CountItems) Top added in v0.3.0

func (items CountItems) Top(n uint) CountItems

func (CountItems) ValuesVec added in v0.3.0

func (items CountItems) ValuesVec() Vector

type Counter added in v0.3.0

type Counter map[string]uint

func NewCounter added in v0.3.0

func NewCounter(str ...string) Counter

func (Counter) Add added in v0.3.0

func (counter Counter) Add(strs ...string) Counter

func (Counter) Copy added in v0.3.0

func (counter Counter) Copy() Counter

func (Counter) Counts added in v0.3.0

func (counter Counter) Counts() []uint

func (Counter) Exclude added in v0.3.0

func (counter Counter) Exclude(strs ...string) Counter

func (Counter) Filter added in v0.3.0

func (counter Counter) Filter(pred func(item CounterItem) bool) Counter

func (Counter) Merge added in v0.3.0

func (counter Counter) Merge(c Counter) Counter

func (Counter) MutAdd added in v0.3.0

func (counter Counter) MutAdd(strs ...string) Counter

func (Counter) MutFilter added in v0.3.0

func (counter Counter) MutFilter(pred func(item CounterItem) bool) Counter

func (Counter) MutMerge added in v0.3.0

func (counter Counter) MutMerge(c Counter) Counter

func (Counter) New added in v0.3.0

func (counter Counter) New() Counter

func (Counter) TopOne added in v0.3.0

func (counter Counter) TopOne() CounterItem

func (Counter) Values added in v0.3.0

func (counter Counter) Values() Vector

type CounterItem added in v0.3.0

type CounterItem struct {
	Value string
	Count uint
}

type Vector

type Vector []string

func Fields added in v0.2.4

func Fields(str string) Vector

func FieldsFunc added in v0.2.4

func FieldsFunc(str string, fieldFunc func(r rune) bool) Vector

func FromChan added in v0.3.4

func FromChan(ch <-chan string, timeout time.Duration) Vector

func FromErrs added in v0.3.0

func FromErrs(errs ...error) Vector

func SplitS added in v0.2.4

func SplitS(str, delim string, n int) Vector

func (Vector) Append

func (vector Vector) Append(strs ...string) Vector

func (Vector) Classify added in v0.2.3

func (vector Vector) Classify(key func(str string) string) map[string][]string

func (Vector) Contains added in v0.3.0

func (vector Vector) Contains(str string) bool

func (Vector) Copy

func (vector Vector) Copy() Vector

func (Vector) Count

func (vector Vector) Count() map[string]uint

func (Vector) Delete

func (vector Vector) Delete(i int) Vector

func (Vector) Eq added in v0.2.4

func (vector Vector) Eq(v Vector) bool

func (Vector) Filter

func (vector Vector) Filter(pred func(str string) bool) Vector

func (Vector) FirstFiltered added in v0.2.2

func (vector Vector) FirstFiltered(pred func(str string) bool) (string, bool)

func (Vector) FirstNonEmpty

func (vector Vector) FirstNonEmpty() string

func (Vector) Fold

func (vector Vector) Fold(start string, op func(acc, str string) string) string

func (Vector) Get added in v0.3.3

func (vector Vector) Get(i int) string

func (Vector) GetDefault added in v0.3.3

func (vector Vector) GetDefault(i int, defaultStr string) string

func (Vector) Head added in v0.3.2

func (vector Vector) Head(n uint) Vector

func (Vector) Inverse added in v0.2.4

func (vector Vector) Inverse() Vector

func (Vector) Join

func (vector Vector) Join(delim string) string

func (Vector) Len

func (vector Vector) Len() int

func (Vector) Map

func (vector Vector) Map(op func(str string) string) Vector

func (Vector) New

func (vector Vector) New() Vector

func (Vector) NonEmpty added in v0.3.7

func (vector Vector) NonEmpty() Vector

func (Vector) Populate

func (vector Vector) Populate(op func(str string) []string) Vector

func (Vector) Sample added in v0.2.2

func (vector Vector) Sample(n uint) Vector

func (Vector) Shuffle added in v0.2.2

func (vector Vector) Shuffle() Vector

func (Vector) Slice

func (vector Vector) Slice() []string

func (Vector) SortByKey added in v0.2.2

func (vector Vector) SortByKey(key func(str string) int) Vector

func (Vector) SortByLess added in v0.2.2

func (vector Vector) SortByLess(less func(a, b string) bool) Vector

func (Vector) Tail added in v0.3.2

func (vector Vector) Tail(n uint) Vector

func (Vector) ToErrs added in v0.3.0

func (vector Vector) ToErrs() []error

func (Vector) Top added in v0.2.2

func (vector Vector) Top(n uint) Vector

func (Vector) Unique added in v0.2.2

func (vector Vector) Unique() Vector

func (Vector) WriteToChan

func (vector Vector) WriteToChan(ch chan<- string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL