Version: v1.2.3 Latest Latest

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

Go to latest
Published: Nov 3, 2020 License: Apache-2.0 Imports: 8 Imported by: 0




This section is empty.


View Source
var (
	ErrInvalidStartPosition = errors.New("start position is invalid")
	ErrInvalidStopPosition  = errors.New("stop position is invalid")


func Contains

func Contains(list []string, str string) bool

func Filter

func Filter(s string, filter func(r rune) bool) string

func GetAxis added in v1.2.1

func GetAxis(row int) string

GetAxis 获取轴 常用于写入Excel

func HasEmpty

func HasEmpty(args ...string) bool

func NotEmpty

func NotEmpty(args ...string) bool

func Rand

func Rand() string

func RandId

func RandId() string

func Randn

func Randn(n int) string

func Remove

func Remove(strings []string, strs ...string) []string

func Reverse

func Reverse(s string) string

func Seed

func Seed(seed int64)

func Substr

func Substr(str string, start int, stop int) (string, error)

Substr returns runes between start and stop [start, stop) regardless of the chars are ascii or utf8

func TakeOne

func TakeOne(valid, or string) string

func TakeWithPriority

func TakeWithPriority(fns ...func() string) string

func Union

func Union(first, second []string) []string


type Replacer

type Replacer interface {
	Replace(text string) string

func NewReplacer

func NewReplacer(mapping map[string]string) Replacer

type Trie

type Trie interface {
	Filter(text string) (string, []string, bool)
	FindKeywords(text string) []string

func NewTrie

func NewTrie(words []string, opts ...TrieOption) Trie

type TrieOption

type TrieOption func(trie *trieNode)

func WithMask

func WithMask(mask rune) TrieOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL