mstr

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Join

func Join(s ...any) string

拼接字符串

var a = []int32{1, 2, 3, 4, 5} joinStr := m_str.Join("mo7", "欢迎你", a, "张三")

fmt.Println("joinStr", joinStr)

func Rand added in v0.1.3

func Rand(length int) string

Rand 生成一个 length 长度的随机字符串。

示例:

s := Rand(8) // 返回类似 "a1b2c3d4" 的字符串

特殊情况:

  • 当 length <= 0 时,返回空字符串

说明:此函数使用 crypto/rand 以避免跨进程/重启时伪随机序列重复,适用于需要更高随机性的场景。

func ToStr

func ToStr(p any) string

func TplFormat

func TplFormat(tplStr string, MapData map[string]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