stringx

package
v0.0.0-...-6d4b899 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package stringx Date: 2023/4/10 14:42 Author: Amu Description:

Package stringx Date: 2023/4/10 14:26 Author: Amu Description:

Package stringx Date: 2023/4/10 14:46 Author: Amu Description:

Package stringx Date: 2023/4/10 14:49 Author: Amu Description:

Index

Constants

This section is empty.

Variables

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

Functions

func Contains

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

func Filter

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

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

Types

type Replacer

type Replacer interface {
	Replace(text string) string
}

func NewReplacer

func NewReplacer(mapping map[string]string) Replacer

Jump to

Keyboard shortcuts

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