strings2

package module
v0.0.0-...-79d3b36 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualFold

func EqualFold(b, s string) bool

func MakeNoZero

func MakeNoZero(l int) []byte

func MakeNoZeroCap

func MakeNoZeroCap(l int, c int) []byte

func Repeat

func Repeat(s string, count int) string

Repeat returns a new string consisting of count copies of the string s.

It panics if count is negative or if the result of (len(s) * count) overflows.

func ReplaceAll

func ReplaceAll(s, old, new string) string

func ReplaceString

func ReplaceString(s, old, new string, n int) string

func ToLower

func ToLower(s string) string

func ToString

func ToString(arg any, timeFormat ...string) string

ToString Change arg to string

func ToUpper

func ToUpper(s string) string

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(cap int) *Builder

NewBuilder returns the new Builder with preallocated cap

func (*Builder) Cap

func (b *Builder) Cap() int

Cap returns the capacity of the builder's underlying byte slice. It is the total space allocated for the string being built and includes any bytes already written.

func (*Builder) Grow

func (b *Builder) Grow(n int)

func (*Builder) Len

func (b *Builder) Len() int

Len returns the number of accumulated bytes; b.Len() == len(b.String()).

func (*Builder) Reset

func (b *Builder) Reset()

Reset resets the Builder to be empty.

func (*Builder) ResetAndKeepCap

func (b *Builder) ResetAndKeepCap()

ResetAndKeepCap sets all data to zero and keep cap

func (*Builder) String

func (b *Builder) String() string

String returns the accumulated string.

func (*Builder) Write

func (b *Builder) Write(p []byte) (int, error)

Write appends the contents of p to b's buffer. Write always returns len(p), nil.

func (*Builder) WriteByte

func (b *Builder) WriteByte(c byte) error

WriteByte appends the byte c to b's buffer. The returned error is always nil.

func (*Builder) WriteRune

func (b *Builder) WriteRune(r rune) (int, error)

WriteRune appends the UTF-8 encoding of Unicode code point r to b's buffer. It returns the length of r and a nil error.

func (*Builder) WriteString

func (b *Builder) WriteString(s string) (int, error)

WriteString appends the contents of s to b's buffer. It returns the length of s and a nil error.

Jump to

Keyboard shortcuts

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