Back to godoc.org

Package str

v1.0.2
Latest Go to latest

The highest tagged major version is .

Published: Jul 11, 2020 | License: Apache-2.0 | Module: gitee.com/crazy4go/easygo

Index

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

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

ToJSON 把对象转换为字符串

func TrimAll

func TrimAll(s ...*string)

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

func TrimJSONErrorChars

func TrimJSONErrorChars(s string) string

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

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier