str

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CutRight

func CutRight(str string, lastTag string) string

CutRight 裁剪末尾标签 str:要裁剪的原字符串 lastTag:裁剪的字符串

func Length added in v0.12.0

func Length(s string) int

Length 字符串的字符长度

func MapToStringList

func MapToStringList[TKey comparable, TValue any](maps map[TKey]TValue) []string

MapToStringList 将map转成字符串数组,map的kv转成:k=v格式

func PadLeft added in v0.9.0

func PadLeft(str string, totalWidth int, paddingChar string) string

PadLeft 为str向左填充paddingChar,直到长度=totalWidth

func PadRight added in v0.12.0

func PadRight(str string, totalWidth int, paddingChar string) string

PadRight 为str向左填充paddingChar,直到长度=totalWidth

func ParseTag added in v0.15.0

func ParseTag(body string, startTag, endTag string) (string, error)

ParseTag 在字符串内,根据开始标记、结束标记,找到标记内的内容

func Substring added in v0.15.0

func Substring(body string, endTag string) (string, error)

Substring 获取从开始到endTag的内容

func ToDateTime

func ToDateTime(t time.Time) string

ToDateTime 将时间转换为yyyy-MM-dd HH:mm:ss

Types

This section is empty.

Jump to

Keyboard shortcuts

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