string

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcciiToStr added in v0.6.0

func AcciiToStr(s int) string

StrToAccii 将accii码转换为大写字母

func Count added in v0.0.13

func Count(s string, c byte) int

Count 查询字符串中出现某个字符的次数

func CutEndString added in v0.0.17

func CutEndString(s string, c rune) string

CutEndString 截取字符串中最后一个字符之后的字符串 例如:CutEndString("abc/def/ghi", '/') => "ghi"

func CutStartString added in v0.0.17

func CutStartString(s string, c rune) string

CutStartString 截取字符串中最后一个字符之前的字符串 例如:CutStartString("abc/def/ghi", '/') => "abc/def/"

func FirstLow added in v0.5.9

func FirstLow(s string) string

FirstLow 首字母小写

func FirstUp added in v0.0.18

func FirstUp(s string) string

FirstUp 首字母大写

func Has

func Has(s string, c byte) bool

Has 判断字符串是否存在某个字符

func IsNumber added in v0.5.5

func IsNumber(s string) bool

IsNumber 判断是否是数字或者小数

func IsPrefix

func IsPrefix(s string, prefix string) bool

IsPrefix 判断字符串是否存在某个前缀

func IsSuffix

func IsSuffix(s string, suffix string) bool

IsSuffix 判断字符串是否存在某个后缀

func Rand added in v0.3.1

func Rand(l int) string

Rand 生成随机字符串

func RandFor added in v0.5.11

func RandFor(l int, seed int64) string

RandV1 生成随机字符串

func RandInt added in v0.4.2

func RandInt(l int) string

RandInt 生成随机数字字符串

func RandStrArr added in v0.5.11

func RandStrArr(l int, n int) []string

RandStrArr 生成随机字符串数组 @param l 长度 @param n 数量

func ReplaceCharAfterSpecifiedCharLow added in v0.0.18

func ReplaceCharAfterSpecifiedCharLow(s, c string) (out string)

ReplaceCharAfterSpecifiedCharLow 替换指定字符后面的字符为小驼峰 例如:ReplaceCharAfterSpecifiedCharLow("abc/def/ghi", '/') => "abcDefGhi"

func ReplaceCharAfterSpecifiedCharUp added in v0.0.18

func ReplaceCharAfterSpecifiedCharUp(s, c string) (out string)

ReplaceCharAfterSpecifiedCharUp 替换指定字符后面的字符为大驼峰 例如:ReplaceCharAfterSpecifiedCharUp("abc/def/ghi", '/') => "AbcDefGhi"

func ToAccii added in v0.6.0

func ToAccii(s string) int

ToAccii 将大写字母转换为accii码

Types

type SafeRand added in v0.3.1

type SafeRand struct {
	Str string
	// contains filtered or unexported fields
}

func (*SafeRand) Rand added in v0.3.1

func (sr *SafeRand) Rand() string

Rand 生成随机字符串

Jump to

Keyboard shortcuts

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