stringx

package
v0.0.0-...-4da1013 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CamelToUnderline

func CamelToUnderline(target string) string

CamelToUnderline 驼峰 to 下划线

func CleanSpace

func CleanSpace(str string) string

清楚空白的地方,包括空格,换行符,tab等

func DeleteExtraSpace

func DeleteExtraSpace(s string) string

DeleteExtraSpace 删除字符串中多余的空格(含tab),有多个空格时,仅保留一个空格,同时将字符串中的tab换为空格

func FillFirst

func FillFirst(str string, length int, char string) string

FillFirst 填充直到长度

func FillLast

func FillLast(str string, length int, char string) string

FillLast 填充直到长度

func GetStrLength

func GetStrLength(str string) float64

GetStrLength 返回输入的字符串的字数,汉字和中文标点算 1 个字数,英文和其他字符 2 个算 1 个字数,不足 1 个算 1个

func IsLowerFirst

func IsLowerFirst(str string) bool

IsLowerFirst 首字母是否小写

func IsUpperFirst

func IsUpperFirst(str string) bool

IsUpperFirst 首字母是否大写

func LowerFirst

func LowerFirst(str string) string

LowerFirst 首字母小写

func ReplaceForamtTypeScript

func ReplaceForamtTypeScript(format string, obj map[string]interface{}) string

${_id}:${内网地址}

func Reverse

func Reverse(str string) string

Reverse 翻转字符串

func SplitLast

func SplitLast(str string, sep string) string

SplitLast 获取字符串被"."分离后的字符串数组中 ,最后一个字符串。

func SplitPrevLast

func SplitPrevLast(str string, sep string) (prev string, last string)

SplitPrevLast 获取字符串被"."分离后的字符串数组中 ,最后一个字符串。

func SplitUpper

func SplitUpper(target string) []string

SplitUpper 按照大小写分组

func UnderlineToCamel

func UnderlineToCamel(target string) string

UnderlineToCamel 下划线 to 驼峰

func UpperFirst

func UpperFirst(str string) string

UpperFirst 首字母大写

Types

This section is empty.

Jump to

Keyboard shortcuts

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