str

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IncludeCN

func IncludeCN(str string) bool

IncludeCN 检查字符串中是否存在汉字字符

func Length

func Length(str string) int

Length 检查字符串长度,如果包含汉字,一个汉字长度为 1

func SubStr

func SubStr(str string, begin, length int) string

SubStr 字符串截取,从begin位开始,取长度为length的子串

func ToInt64

func ToInt64(str string) (value int64, err error)

ToInt64 字符串转10进制int64

func ToJSON added in v1.0.2

func ToJSON(obj interface{}) (str string)

ToJSON 把对象转换为字符串

func TrimAll

func TrimAll(s ...*string)

TrimAll 去掉字符串首尾空格和其中的回车换行符 传入字符串指针,不需要返回值

func TrimJSONErrorChars

func TrimJSONErrorChars(s string) string

TrimJSONErrorChars 去掉可能导致JSON解析错误的字符

Types

This section is empty.

Jump to

Keyboard shortcuts

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