gstring

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendArg

func AppendArg(b []byte, v interface{}) []byte

func Bytes

func Bytes(s string) []byte

Bytes converts string to byte slice.

func CodeToIDBase34

func CodeToIDBase34(idByte []byte) (uint64, error)

CodeToIDBase34 -- 将code逆向转换成原始id

func CodeToIDReverse added in v0.4.0

func CodeToIDReverse(code string) (int64, error)

CodeToIDReverse -- 将code逆向转换成原始id

func Contains

func Contains(target interface{}, obj interface{}) bool

Contains fun

func ContainsString

func ContainsString(slice []string, item string) bool

ContainsString fun

func GenCodeBase34

func GenCodeBase34(id uint64) []byte

GenCodeBase34 -- 将id转换成6位长度的code

func GenCodeReverse added in v0.4.0

func GenCodeReverse(id int64) string

GenCodeReverse 将id转换成n位长度的code

func Join

func Join(elems []string, sep string) string

Join concatenates the elements of its first argument to create a single string. The separator string sep is placed between elements in the resulting string.

func LowercaseFirst

func LowercaseFirst(str string) string

LowercaseFirst fun

func NewLine

func NewLine() string

NewLine new line

func PadLeft

func PadLeft(s string, pad string, plength int) string

PadLeft fun

func RandomString

func RandomString(length int) string

RandomString fun

func Reverse added in v0.4.0

func Reverse(x int64) int64

Reverse 字符串翻转

func String

func String(b []byte) string

String converts byte slice to string.

func Sub

func Sub(str string, start int, length int) string

Sub fun

func UppercaseFirst

func UppercaseFirst(str string) string

UppercaseFirst fun

Types

This section is empty.

Jump to

Keyboard shortcuts

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