Documentation ¶
Index ¶
- func BytesToString(b []byte) string
- func CleanString(origStr string, args ...bool) string
- func CsvToInt32s(s string) []int32
- func CsvToInt64s(s string) []int64
- func CsvToInts(s string) []int
- func FuncEqual(fn1, fn2 any) bool
- func GetFuncName(fn any) string
- func GetFuncSignature(fn any) string
- func GetStructName(obj any) string
- func GetVarName(v any) string
- func Int32sToCsv(int32s []int32) string
- func Int64sToCsv(int64s []int64) string
- func IsAlphanumeric(s string) bool
- func IsImageData(data []byte) bool
- func IsNumeric(s string) bool
- func IsValidMobile(mobile string) bool
- func MatchReceiverMethods(receiver any, matchFn any) map[string]any
- func OnlyAlphaNumeric(s string) string
- func OnlyChinese(s string) string
- func OnlyNumeric(s string) string
- func StringToBytes(s string) []byte
- func StructSet(obj any, nilField any, val any) error
- func ToBytes(value any) ([]byte, error)
- func ToCamelCase(s string) string
- func ToFixed(num float64, precision int) float64
- func ToInt32s(strSlice []string) []int32
- func ToInt64s(strSlice []string) []int64
- func ToInts(strSlice []string) []int
- func ToSlice(data any) []any
- func ToSnakeCase(s string) string
- func ToString(value any) (string, error)
- type Value
- type ValueItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToString ¶
BytesToString converts byte slice to text without a memory allocation.
func CleanString ¶
CleanString 处理字符串, args[0]为是否转换为小写
func CsvToInt32s ¶
CsvToInt32s 将逗号分隔的string尝试转换成[1,2,3...]的int32 slice Csv means Comma Separated Value
func CsvToInt64s ¶
CsvToInt64s 将逗号分隔的string尝试转换成[1,2,3...]的int64 slice Csv means Comma Separated Value
func Int32sToCsv ¶
Int32sToCsv 将int32 slice转换成用逗号分隔的字符串: 1,2,3
func Int64sToCsv ¶
Int64sToCsv 将int64 slice转换成用逗号分隔的字符串: 1,2,3
func IsAlphanumeric ¶
IsAlphanumeric check if the text contains only letters and numbers. Empty text is valid.
func IsValidMobile ¶
IsValidMobile check if the text is valid chinese mobile number
func MatchReceiverMethods ¶
MatchReceiverMethods 匹配receiver的所有methods中与matchFn签名参数类似的方法
func StringToBytes ¶
StringToBytes converts text to byte slice without a memory allocation.
func ToCamelCase ¶
ToCamelCase converts from underscore separated form to camel case form.
func ToSnakeCase ¶
ToSnakeCase converts from camel case form to underscore separated form.