gostring

package
v1.0.193 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToString added in v1.0.60

func BytesToString(b []byte) string

func CompleteUrlHttp added in v1.0.149

func CompleteUrlHttp(url string) string

CompleteUrlHttp 补全 URL

func CompleteUrlHttps added in v1.0.149

func CompleteUrlHttps(url string) string

CompleteUrlHttps 补全 URL

func Contains added in v1.0.47

func Contains(s, sep string) bool

Contains 判断字符串是否包含某个字符

func GenerateId added in v1.0.51

func GenerateId(customId string) string

GenerateId 生成18位编号

func GenerateIdAndTime added in v1.0.51

func GenerateIdAndTime(customId, customTime string) string

GenerateIdAndTime 生成18位编号

func GenerateIdAndTimeLength added in v1.0.88

func GenerateIdAndTimeLength(customId, customTime string, dataLength int) string

GenerateIdAndTimeLength 生成自定义长度编号

func GenerateIdLength added in v1.0.88

func GenerateIdLength(customId string, dataLength int) string

GenerateIdLength 生成自定义长度编号

func GenerateRandom added in v1.0.52

func GenerateRandom(length, count int) []int

GenerateRandom 生成count个长度length不重复的随机数

func GenerateRandomFunc added in v1.0.52

func GenerateRandomFunc(length, count int, dFun func(num int) bool) []int

GenerateRandomFunc 生成count个长度length不重复的随机数,支持外部查询

func GenerateRandomNumber added in v1.0.52

func GenerateRandomNumber(start, end, count int, dFun func(num int) bool) []int

GenerateRandomNumber 生成count个[start,end)结束的不重复的随机数

func GetDefault added in v1.0.52

func GetDefault(key, defVal any) any

func GetString added in v1.0.172

func GetString(i interface{}) string

func GetStringDefault added in v1.0.52

func GetStringDefault(key, defVal string) string

func GetUuId added in v1.0.51

func GetUuId() string

GetUuId 由 32 个十六进制数字组成,以 6 个组显示,由连字符 - 分隔

func HmacSha256Hex

func HmacSha256Hex(key, strToSign string) string

func LineBreak

func LineBreak(str string) string

LineBreak 去除换行符

func NumericalToString

func NumericalToString(value interface{}) (string, bool)

func Replace

func Replace(str, old, new string) string

Replace 字符串替换

func Space

func Space(str string) string

Space 去除空格

func SpaceAndLineBreak

func SpaceAndLineBreak(str string) string

SpaceAndLineBreak 去除空格和去除换行符

func Split

func Split(s string, sep string) []string

Split 字符串分隔

func StringToBytes added in v1.0.60

func StringToBytes(s string) []byte

func ToFloat64

func ToFloat64(s string) float64

ToFloat64 string到float64

func ToInt

func ToInt(s string) int

ToInt string到int

func ToInt64

func ToInt64(s string) int64

ToInt64 string到int64

func ToLower added in v1.0.135

func ToLower(s string) string

ToLower 转小写

func ToString added in v1.0.47

func ToString(value interface{}) string

ToString 转换成string

func ToUint added in v1.0.44

func ToUint(s string) uint

ToUint string到uint64

func ToUint64 added in v1.0.44

func ToUint64(s string) uint64

ToUint64 string到uint64

func ToUpper added in v1.0.135

func ToUpper(s string) string

ToUpper 转大写

func TrimLastChar

func TrimLastChar(s string) string

TrimLastChar 删除字符串中的最后一个

Types

type Only added in v1.0.51

type Only struct {
}

func NewOnly added in v1.0.51

func NewOnly() *Only

Jump to

Keyboard shortcuts

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