strings

package
v0.0.0-...-8aeec60 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: MIT Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuilderFormat

func BuilderFormat(s *strings.Builder, format string, args ...any)

func BuilderJoin

func BuilderJoin(s *strings.Builder, str ...string)

func CamelCaseTo

func CamelCaseTo(s string, delimiter rune) string

CamelCaseTo 驼峰单词转下划线或横杠单词 //分隔符

func CutSpecialDuplicate

func CutSpecialDuplicate(s, char string) string

CutSpecialDuplicate '\t', '\n', '\v', '\f', '\r', ' ', U+0085 (NEL), U+00A0 (NBSP)

func FirstUpper

func FirstUpper(s string) string

func Join

func Join(s ...string) (str string)

func Md5

func Md5(str string) string

func Replace

func Replace(s string, replace map[string]string) string

func Replaces

func Replaces(s string, replace ...[]string) string

Replaces replace string by slice as order

[]string sub []string like {old1,old2,old3,....,newString} all old[x] will be replaced by lasted newString

func ToInt

func ToInt[T constraints.Integer](s string) T

func ToInteger

func ToInteger[T constraints.Integer](s string, defaults T) T

Types

type Builder

type Builder struct {
	*strings.Builder
}

func NewBuilder

func NewBuilder() *Builder

func (*Builder) Sprintf

func (b *Builder) Sprintf(format string, a ...any) int

func (*Builder) WriteString

func (b *Builder) WriteString(s ...string) (count int)

Jump to

Keyboard shortcuts

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