strHelper

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64Decode added in v1.5.6

func Base64Decode(str string) (data []byte)

*

  • @func: Base64_decode 解码
  • @author Wiidz
  • @date 2019-11-16

func Base64Encode added in v1.5.6

func Base64Encode(src []byte) (str string)

*

  • @func: Base64_encode base64编码
  • @author Wiidz
  • @date 2019-11-16

func EncryptCenter added in v1.5.6

func EncryptCenter(source string) string

EncryptCenter 用符号替换中间字符,保留首位

func EncryptStr added in v1.5.6

func EncryptStr(source string, prefixAmount, suffixAmount int, symbol string) string

EncryptStr 用特定符号加密字符串 prefixAmount 前缀加密长度 suffixAmount 后缀加密长度

func Exist added in v1.5.6

func Exist(targetStr, needleStr string) bool

Exist 判断目标字符串中是否存在需要的字符

func GetAlphabetRank added in v1.5.6

func GetAlphabetRank(letter string) (rank int, err error)

GetAlphabetRank 获取字母的排序(1-26),无论大小写

func GetAsciiValue added in v1.5.6

func GetAsciiValue(letter string) (asciiValue int, err error)

GetAsciiValue 获取ascii值(只接受一个值)

func GetPinyin added in v1.5.6

func GetPinyin(zhStr string, style int) (result string)

GetPinyin 这里的pinyin取pinyin.FirstLetter 之类的

func GetPinyinFirstLetter added in v1.5.6

func GetPinyinFirstLetter(zhStr string) (result string)

GetPinyinFirstLetter 获取首字母

func GetPinyinFull added in v1.5.6

func GetPinyinFull(zhStr string) (result string)

GetPinyinFull 获取拼音全拼

func GetRandomNumbers added in v1.5.6

func GetRandomNumbers(l int) string

GetRandomNumbers 获取指定位数的随机字符串

func GetRandomString

func GetRandomString(l int) string

GetRandomString 获取指定位数的随机字符串

func GetUUID added in v1.5.6

func GetUUID() uuid.UUID

GetUUID 创建uuid

func GetWordsLength

func GetWordsLength(str string) float64

*

  • @func: GetWordLength 文字=1,标点符号=0.5,获取长度
  • @author Wiidz
  • @date 2019-11-16

func LimitLength added in v1.5.6

func LimitLength(str string, maxLength int) string

LimitLength 限制字符长度

func StripTags

func StripTags(body string) string

*

  • @func: StripTags 去除文本中的html标签
  • @author Wiidz
  • @date 2019-11-16

func Substr

func Substr(s string, start, length int) string

*

  • @func: Substr 截取字符串
  • @author Wiidz
  • @date 2019-11-16

func Trim

func Trim(str string) (data string)

*

  • @func: Trim 过滤空字符串(不可靠)
  • @author Wiidz
  • @date 2019-11-16

func ValidatePhone

func ValidatePhone(phoneNum string) bool

ValidatePhone 正则验证是否是手机号

Types

This section is empty.

Jump to

Keyboard shortcuts

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