convert

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const EmptySpace = " "

EmptySpace 字符中有空格

View Source
const EmptyString = ""

EmptyString 空字符串

Variables

This section is empty.

Functions

func AppendStr

func AppendStr(sts []string, str string) []string

AppendStr 将字符串追加到数组中,且没有重复。

func ArrayToString

func ArrayToString(A []int, denim string) string

ArrayToString 整形数组转换成字符串

func Bytes2Str

func Bytes2Str(b []byte) string

func Contains

func Contains(array interface{}, val interface{}) (index int)

Contains 返回数组中val的索引位置,当为-1时代表不包含

func ContainsBool

func ContainsBool(array []bool, val bool) (index int)

ContainsBool 返回bool类型'val'在数组中的索引位置

func ContainsComplex

func ContainsComplex(array []complex128, val complex128) (index int)

ContainsComplex 返回complex128类型'val'在数组中的索引位置

func ContainsFloat

func ContainsFloat(array []float64, val float64) (index int)

ContainsFloat 返回float64类型'val'在数组中的索引位置

func ContainsInt

func ContainsInt(array []int64, val int64) (index int)

ContainsInt 返回int64类型'val'在数组中的索引位置

func ContainsString

func ContainsString(array []string, val string) (index int)

ContainsString 返回string类型'val'在数组中的索引位置

func ContainsUint

func ContainsUint(array []uint64, val uint64) (index int)

ContainsUint 返回uint64类型'val'在数组中的索引位置

func HasText

func HasText(source string) bool

HasText 判断是否有值

func IsBlank

func IsBlank(source string) bool

IsBlank 判断是否存在空格

func PowInt

func PowInt(x int, y int) int

PowInt 是int类型的Math.Pow函数.

func StartsWith

func StartsWith(str, prefix string, offset int) bool

func Str2Bytes

func Str2Bytes(s string) []byte

func ToStr

func ToStr(value interface{}, args ...int) (s string)

ToStr 将任何类型转换为字符串。

func TokenizeToStringArray

func TokenizeToStringArray(str, delimiters string, trimTokens, ignoreEmptyTokens bool) []*string

TokenizeToStringArray 根据分隔符进行分割处理,形成包路径数组.默认分割符为:",; \t\n"

func TokenizeToStringArrayIgnoreEmptyTokens

func TokenizeToStringArrayIgnoreEmptyTokens(str, delimiters string) []*string

TokenizeToStringArrayIgnoreEmptyTokens 根据分隔符进行分割处理并路过空字符

Types

type ArgAny

type ArgAny []interface{}

func (ArgAny) Get

func (a ArgAny) Get(i int, args ...interface{}) (r interface{})

type ArgInt

type ArgInt []int

func (ArgInt) Get

func (a ArgInt) Get(i int, args ...int) (r int)

type ArgString

type ArgString []string

func (ArgString) Get

func (a ArgString) Get(i int, args ...string) (r string)

type StrTo

type StrTo string

StrTo 转换字符串以指定类型。

func (StrTo) Exist

func (f StrTo) Exist() bool

func (StrTo) Float64

func (f StrTo) Float64() float64

func (StrTo) Hash

func (f StrTo) Hash() string

func (StrTo) Int

func (f StrTo) Int() (int, error)

func (StrTo) Int64

func (f StrTo) Int64() (int64, error)

func (StrTo) MustInt

func (f StrTo) MustInt() int

func (StrTo) MustInt64

func (f StrTo) MustInt64() int64

func (StrTo) MustUint8

func (f StrTo) MustUint8() uint8

func (StrTo) String

func (f StrTo) String() string

func (StrTo) Uint8

func (f StrTo) Uint8() (uint8, error)

Jump to

Keyboard shortcuts

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