stringutil

package
v1.2.19 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: Zlib Imports: 6 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesTo added in v0.5.5

func BytesTo[T BType](bys []byte, def T) T

BytesTo BType not int

func BytesToUInt32 added in v1.0.37

func BytesToUInt32(bys []byte) uint32

func BytesToUInt64 added in v1.0.37

func BytesToUInt64(bys []byte) uint64

func DefaultString

func DefaultString(a string, def string) string

func Float64ToString

func Float64ToString(a float64, prec, bitSize int) string

func GetChinaPhone added in v1.0.53

func GetChinaPhone(num string) string

func GetHKPhone added in v1.0.53

func GetHKPhone(num string) string

func HasChinaPhoneLegal added in v1.0.53

func HasChinaPhoneLegal(num string) bool

func HasHKPhoneLegal added in v1.0.53

func HasHKPhoneLegal(num string) bool

func HasPhoneLegal added in v1.0.53

func HasPhoneLegal(num string) bool

func Int32ToString added in v1.0.52

func Int32ToString(a int32) string

func Int64ToString

func Int64ToString(a int64) string

func IntToString

func IntToString(a int) string

func IsEmailValidate

func IsEmailValidate(email string) bool

IsEmailValidate 邮箱合规

func IsNameValidate

func IsNameValidate(name string) bool

IsNameValidate 用户名验证

func IsPhoneExtValidate added in v1.2.17

func IsPhoneExtValidate(mobile string) bool

IsPhoneExtValidate 带分机

func IsPhoneValidate

func IsPhoneValidate(mobile string) bool

IsPhoneValidate 手机验证

func NumberValue added in v0.3.9

func NumberValue(number string) (num, decimal int)

func PercentIf added in v0.3.9

func PercentIf(number string) (int, bool)

PercentIf 是否按比例分,是返回,比例值,true

func StringToInt

func StringToInt(a string) int

func StringToInt32 added in v1.0.52

func StringToInt32(a string) int32

func StringToInt64

func StringToInt64(a string) int64

func StringToUInt32 added in v1.0.52

func StringToUInt32(a string) uint32

func StringToUInt64

func StringToUInt64(a string) uint64

func StringsToInt added in v0.4.3

func StringsToInt(arr []string) []int

func ToBytes added in v0.5.5

func ToBytes[T BType](n T) []byte

func UInt32ToBytes added in v1.0.37

func UInt32ToBytes(n uint32) []byte

func UInt32ToString added in v1.0.52

func UInt32ToString(a uint32) string

func UInt64ToBytes added in v1.0.37

func UInt64ToBytes(n uint64) []byte

func UInt64ToString

func UInt64ToString(a uint64) string

func Uuid

func Uuid() string

func UuidNot

func UuidNot() string

Types

type BType added in v0.5.5

type BType interface {
	int8 | int16 | int32 | int64 |
		uint8 | uint16 | uint32 | uint64 |
		float64 | float32 | bool
}

Jump to

Keyboard shortcuts

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