stringutil

package
v0.0.0-...-7647e70 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 12 Imported by: 65

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(slice []string, item string) bool

Contains 判断slice中是否包含某个字符串

func ConvertID

func ConvertID(intId int64) string

ConvertID 转换数字ID到字符串

func JSONEncode

func JSONEncode(v interface{}) string

JSONEncode JSON Encode

func JSONEncodePretty

func JSONEncodePretty(v interface{}) string

JSONEncodePretty JSON Encode Pretty

func Md5

func Md5(source string) string

Md5 计算字符串的md5

func ParseFileSize

func ParseFileSize(sizeString string) (float64, error)

ParseFileSize 从字符串中分析尺寸

func Rand

func Rand(n int) string

Rand 取得随机字符串

func RegexpCompile

func RegexpCompile(pattern string) (*regexp.Regexp, error)

RegexpCompile 生成可重用的正则

func Reverse

func Reverse(s string) string

Reverse 翻转字符串

func VersionCompare

func VersionCompare(version1 string, version2 string) int8

VersionCompare 对比版本号,返回-1,0,1三个值

Types

This section is empty.

Jump to

Keyboard shortcuts

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