str

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(s, sub string) bool

Contains 判断字符串s中是否包含字串sub

基于strings包实现 strings.Contains

func Join

func Join(s []string, sep string) string

Join 将多个字符串通过连接符拼接起来,例:["abc","def","ghi"] 通过-连接 "abc-def-ghi"

func NumCaptcha

func NumCaptcha(digit int) string

NumCaptcha 生成数字验证码

digit 验证码位数,取值4-8,默认4位

func Split

func Split(s, sep string) []string

Split 将字符串按分隔符分割为多个字符串 例:"abc-def-ghi" 按-分割 ["abc","def","ghi"]

func Trim

func Trim(s string, cutset string) string

Trim 在s字符串的头部和尾部去除cutset指定的字符串

Types

This section is empty.

Jump to

Keyboard shortcuts

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