commonutil

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 5, 2021 License: MIT Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolToString

func BoolToString(b bool) string

func BytesToDecimal

func BytesToDecimal(bytes []byte) decimal.Decimal

[]byte转decimal

func BytesToStringNoCopy

func BytesToStringNoCopy(bytes *[]byte) *string

func CombinePath

func CombinePath(args ...string) string

拼接path

func DecimalLeftShift

func DecimalLeftShift(d decimal.Decimal, decimals int32) decimal.Decimal

十进制左移

func DecimalRightShift

func DecimalRightShift(d decimal.Decimal, decimals int32) decimal.Decimal

十进制右移

func DecimalToBytes

func DecimalToBytes(d decimal.Decimal) []byte

decimal转[]byte

func DecimalToString

func DecimalToString(d decimal.Decimal) string

func EqualStringIgnoreCase

func EqualStringIgnoreCase(a, b string) bool

忽略大小写比较两个字符串是一致

func Float32ToString

func Float32ToString(f float32) string

func Float64ToString

func Float64ToString(f float64) string

func GetProgramRootPath

func GetProgramRootPath() string

获取程序根目录

func Int32ToString

func Int32ToString(i int32) string

func Int64ToString

func Int64ToString(i int64) string

func IntToBool

func IntToBool(i int32) bool

func IntToString

func IntToString(i int) string

func IsExistPath

func IsExistPath(path string) bool

func IsNilOrWhiteSpace

func IsNilOrWhiteSpace(s string) bool

是否为null或空字符串

func MapPath

func MapPath(uri string) string

将uri形式的路径映射为物理路径

func ParseBool

func ParseBool(b string) bool

func ParseDecimal

func ParseDecimal(s string) decimal.Decimal

func ParseFloat32

func ParseFloat32(s string) float32

func ParseFloat64

func ParseFloat64(s string) float64

func ParseInt

func ParseInt(s string) int

func ParseInt32

func ParseInt32(s string) int32

func ParseInt64

func ParseInt64(s string) int64

func ReadFile

func ReadFile(path string) string

func ReadFileBytes

func ReadFileBytes(path string) []byte

func StringContainsAny

func StringContainsAny(s string, arr *[]string)

判断字符串是否包含数组中任意一个元素

func StringContainsAnyIgnoreCase

func StringContainsAnyIgnoreCase(s string, arr *[]string)

判断字符串是否包含数组中任意一个元素,忽略大小写

func StringToBytesNoCopy

func StringToBytesNoCopy(s *string) *[]byte

func Substring

func Substring(source string, start int, length int) string

按指定的开始下标与长度截取字符串

Types

This section is empty.

Jump to

Keyboard shortcuts

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