strutil

package
v1.5.8 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolsToStrs

func BoolsToStrs(items []bool) []string

func CheckStrLen

func CheckStrLen(str string, minLen, maxLen int) bool

func CheckVaildAbbr

func CheckVaildAbbr(abbr string, size int) bool

func CheckVaildName

func CheckVaildName(name string, minLen, maxLen int) bool

func CheckVaildName1

func CheckVaildName1(name string, minLen, maxLen int) bool

可以包含空格,字符串首尾不能有空格

func Clamp

func Clamp(x, lo, hi float64) float64

func ClampInt

func ClampInt(x, lo, hi int) int

func Degrees

func Degrees(radians float64) float64

func DurationString

func DurationString(d time.Duration) string

func FirstIsLower

func FirstIsLower(s string) bool

func FirstIsUpper

func FirstIsUpper(s string) bool

func FirstToLower

func FirstToLower(s string) string

func FirstToUpper

func FirstToUpper(s string) string

func Float32sToStrs

func Float32sToStrs(items []float32) []string

func Float64sToStrs

func Float64sToStrs(items []float64) []string

func Fract

func Fract(x float64) float64

func Int16sToStrs

func Int16sToStrs(items []int16) []string

func Int32sToStrs

func Int32sToStrs(items []int32) []string

func Int64sToStrs

func Int64sToStrs(items []int64) []string

func Int8sToStrs

func Int8sToStrs(items []int8) []string

func IntsToStrs

func IntsToStrs(items []int) []string

func M2bool

func M2bool(i interface{}) bool

func M2float32

func M2float32(i interface{}) float32

func M2float64

func M2float64(i interface{}) float64

func M2int16

func M2int16(i interface{}) int16

func M2int32

func M2int32(i interface{}) int32

func M2int64

func M2int64(i interface{}) int64

func M2int8

func M2int8(i interface{}) int8

func M2string

func M2string(i interface{}) string

func M2uint16

func M2uint16(i interface{}) uint16

func M2uint32

func M2uint32(i interface{}) uint32

func M2uint64

func M2uint64(i interface{}) uint64

func M2uint8

func M2uint8(i interface{}) uint8

func Median

func Median(items []float64) float64

func ParseBools

func ParseBools(items []string) ([]bool, error)

ParseBools 忽略空字符串

func ParseFloat32s

func ParseFloat32s(items []string) ([]float32, error)

ParseFloat32s 忽略空字符串

func ParseFloat64s

func ParseFloat64s(items []string) ([]float64, error)

ParseFloat64s 忽略空字符串

func ParseInt16s

func ParseInt16s(items []string) ([]int16, error)

ParseInt16s 忽略空字符串

func ParseInt32s

func ParseInt32s(items []string) ([]int32, error)

ParseInt32s 忽略空字符串

func ParseInt64s

func ParseInt64s(items []string) ([]int64, error)

ParseInt64s 忽略空字符串

func ParseInt8s

func ParseInt8s(items []string) ([]int8, error)

ParseInt8s 忽略空字符串

func ParseInts

func ParseInts(items []string) ([]int, error)

ParseInts 忽略空字符串

func ParseUint64s

func ParseUint64s(items []string) ([]uint64, error)

ParseUint64s 忽略空字符串

func Radians

func Radians(degrees float64) float64

func RandStr

func RandStr(n int) string

func ShowProgress

func ShowProgress(start time.Time, rays uint64, crtValue, totalValue int)

func Slice

func Slice(s string) (b []byte)

no copy to change string to slice

func StoBol

func StoBol(v string, def ...bool) bool

StoBol 没找到并且没有默认值则 panic抛错

func Stof32

func Stof32(v string, def ...float32) float32

Stof32 没找到并且没有默认值则 panic抛错

func Stof64

func Stof64(v string, def ...float64) float64

Stof64 没找到并且没有默认值则 panic抛错

func Stoi

func Stoi(v string, def ...int) int

Stoi 没找到并且没有默认值则 panic抛错

func Stoi16

func Stoi16(v string, def ...int16) int16

Stoi16 没找到并且没有默认值则 panic抛错

func Stoi32

func Stoi32(v string, def ...int32) int32

Stoi32 没找到并且没有默认值则 panic抛错

func Stoi64

func Stoi64(v string, def ...int64) int64

Stoi64 没找到并且没有默认值则 panic抛错

func Stoi8

func Stoi8(v string, def ...int8) int8

Stoi8 没找到并且没有默认值则 panic抛错

func Stou

func Stou(v string, def ...uint) uint

Stou 没找到并且没有默认值则 panic抛错

func Stou16

func Stou16(v string, def ...uint16) uint16

Stou16 没找到并且没有默认值则 panic抛错

func Stou32

func Stou32(v string, def ...uint32) uint32

Stou32 没找到并且没有默认值则 panic抛错

func Stou64

func Stou64(v string, def ...uint64) uint64

Stou64 没找到并且没有默认值则 panic抛错

func Stou8

func Stou8(v string, def ...uint8) uint8

Stou8 没找到并且没有默认值则 panic抛错

func String

func String(b []byte) (s string)

no copy to change slice to string

Types

This section is empty.

Jump to

Keyboard shortcuts

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