Convert

package
v0.0.0-...-74cfed9 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Convert

type Convert byte

func (*Convert) Big5ToUtf8

func (*Convert) Big5ToUtf8(str string) (string, error)

Big5ToUtf8 BIG5转UTF-8编码.

func (*Convert) Charset

func (*Convert) Charset(src string, srcCharset string, dstCharset string) (dst string, err error)

Charset 强制将变量转换为整型.

func (*Convert) DbcToSbc

func (*Convert) DbcToSbc(s string) string

DbcToSbc 半角转全角.

func (*Convert) GbkToUtf8

func (*Convert) GbkToUtf8(str string) (string, error)

GbkToUtf8 GBK转UTF-8编码.

func (*Convert) JsonToMap

func (*Convert) JsonToMap(jsonString string) (map[string]interface{}, error)

JsonToMap 将json转为map类型.

func (*Convert) JsonpToJson

func (*Convert) JsonpToJson(str string) (string, error)

JsonpToJson 将jsonp转为json串. Example: forbar({a:"1",b:2}) to {"a":"1","b":2}

func (*Convert) SbcToDbc

func (*Convert) SbcToDbc(s string) string

SbcToDbc 全角转半角.

func (*Convert) ToBool

func (*Convert) ToBool(value interface{}) (bool, error)

ToBool 强制将变量转换为整型.

func (*Convert) ToFloat32

func (*Convert) ToFloat32(value interface{}) (float32, error)

ToFloat32 强制将变量转换为整型.

func (*Convert) ToFloat64

func (*Convert) ToFloat64(value interface{}) (float64, error)

ToFloat64 强制将变量转换为整型.

func (*Convert) ToInt

func (*Convert) ToInt(value interface{}) (int, error)

ToInt 强制将变量转换为整型.

func (*Convert) ToInt16

func (*Convert) ToInt16(value interface{}) (int16, error)

ToInt16 强制将变量转换为int16类型.

func (*Convert) ToInt32

func (*Convert) ToInt32(value interface{}) (int32, error)

ToInt32 强制将变量转换为int32类型.

func (*Convert) ToInt64

func (*Convert) ToInt64(value interface{}) (int64, error)

ToInt64 强制将变量转换为int64类型.

func (*Convert) ToInt8

func (*Convert) ToInt8(value interface{}) (int8, error)

ToInt8 强制将变量转换为int8类型.

func (*Convert) ToStr

func (*Convert) ToStr(value interface{}) (string, error)

ToStr 强制将变量转换为字符串.

func (*Convert) ToUint

func (*Convert) ToUint(value interface{}) (uint, error)

ToUint 强制将变量转换为整型.

func (*Convert) ToUint16

func (*Convert) ToUint16(value interface{}) (uint16, error)

ToUint16 强制将变量转换为int16类型.

func (*Convert) ToUint32

func (*Convert) ToUint32(value interface{}) (uint32, error)

ToUint32 强制将变量转换为int32类型.

func (*Convert) ToUint64

func (*Convert) ToUint64(value interface{}) (uint64, error)

ToUint64 强制将变量转换为int64类型.

func (*Convert) ToUint8

func (*Convert) ToUint8(value interface{}) (uint8, error)

ToUint8 强制将变量转换为int8类型.

func (*Convert) ToUnicode

func (*Convert) ToUnicode(text string) string

ToUnicode 字符串转HTML编码

func (*Convert) Utf8ToBig5

func (*Convert) Utf8ToBig5(str string) (string, error)

Utf8ToBig5 UTF-8转BIG5编码.

func (*Convert) Utf8ToGbk

func (*Convert) Utf8ToGbk(str string) (string, error)

Utf8ToGbk UTF-8转GBK编码.

Jump to

Keyboard shortcuts

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