gostr

package
v1.8.10 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: LGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Calculator

func Calculator(exp string) (string, error)

Calculator 输入字符串数学表达式,将计算出结果

func FilterEmptyChar

func FilterEmptyChar(str string) string

func GenSha1

func GenSha1(input string) string

func GenStrBySeed

func GenStrBySeed(input, seed string) string

GenStrBySeed 根据给定的字符串和种子生成一个可重现的新字符串(不建议用到密码)

func GetDirNameFromSnowflakeID

func GetDirNameFromSnowflakeID(snowflakeID int64) string

func IsAlphaNum

func IsAlphaNum(str string) bool

func Length

func Length(str string) int

func Md5

func Md5(str string) string

func NanoTimestampStr

func NanoTimestampStr() string

func PadCnSpaceChar

func PadCnSpaceChar(label string, spaces int) string

PadCnSpaceChar 使用中文空格为字符串填充

func ProtoMessageToJson

func ProtoMessageToJson(msg proto.Message) (string, error)

func RandomId

func RandomId() string

func RegexpMatch

func RegexpMatch(text string, pattern string) bool

func StrToInt64

func StrToInt64(intStr string) (int64, error)

func StringToInt64 added in v1.8.5

func StringToInt64(str string) (int64, error)

StringToInt64 字符串数字转换成int64

func StringToNumber

func StringToNumber(str string) uint32

StringToNumber 字符串转换成uint32

func UUIDNoDash

func UUIDNoDash() string

func UniqueStrings

func UniqueStrings(input []string) []string

UniqueStrings 返回一个新的切片,其中包含原切片中的唯一字符串

Types

This section is empty.

Jump to

Keyboard shortcuts

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