strutil

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CamelCaseToUnderscore

func CamelCaseToUnderscore(s string) string

驼峰转下划线

func Decode

func Decode(text string) (string, error)

转义\u00e9文字 转义\xE9\x80文字

func FindMatch

func FindMatch(str, s, e string, fix bool) []string

前后缀匹配

func FindMatchFirst

func FindMatchFirst(str, s, e string, fix bool) string

前后缀匹配出第一个

func IndexOf

func IndexOf(text, substr string, index int) int

完善 strings.Index, 多加入索引位置参数

func InsertString

func InsertString(text *string, insert, template string)

插入文本, 插入的内容 @insert 会放在原始文本 @text 中 @template 的前面 在 @insert 中搜索 @template 的位置 @st 在 @st 位置 前 插入 @insert 的字符串文本内容 @param text 原始文本 @param insert 插入的内容 @param template 查询字符串

func IsChineseChar

func IsChineseChar(str string) bool

判断字符串是否包含中文

func MatchString

func MatchString(text, prefix, suffix string, fix bool) []string

基于 strings.Index 实现的前后缀匹配查找

func MatchStringFirst

func MatchStringFirst(text, prefix, suffix string, fix bool) string

基于 strings.Index 实现的前后缀匹配查找第一个

func UnderscoreToLowerCamelCase

func UnderscoreToLowerCamelCase(s string) string

下划线转小写驼峰

func UnderscoreToUpperCamelCase

func UnderscoreToUpperCamelCase(s string) string

下划线转驼峰

Types

This section is empty.

Jump to

Keyboard shortcuts

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