texts

package
v0.0.0-...-c18a219 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareFold

func CompareFold(s, t string) int

CompareFold reports whether s and t, interpreted as UTF-8 strings, are equal under Unicode case-folding.

func Concat

func Concat(a ...string) string

func Contains

func Contains(a []string, s string) bool

func CutLeft

func CutLeft(s string, w int) string

func CutRight

func CutRight(s string, w int) string

func IsLower

func IsLower(s string) bool

func IsUpper

func IsUpper(s string) bool

func Join

func Join(sep string, a ...string) string

Join is a fast-version of `strings.Join` function.

func JoinRepeat

func JoinRepeat(s, sep string, count int) string

JoinRepeat if sep = "", should use strings.Repeat instead

func PadCenter

func PadCenter(s string, c byte, w int) string

func PadLeft

func PadLeft(s string, c byte, w int) string

func PadRight

func PadRight(s string, c byte, w int) string

func PutBuilder

func PutBuilder(b *Builder)

func Rename

func Rename(name string, style NameStyle) string

Types

type Builder

type Builder bytes.Buffer

Builder is used to efficiently build a string using Write methods. It minimizes memory copying. The zero value is ready to use.

func GetBuilder

func GetBuilder() *Builder

func (*Builder) Bytes

func (b *Builder) Bytes() []byte

func (*Builder) Len

func (b *Builder) Len() int

func (*Builder) Reset

func (b *Builder) Reset() *Builder

func (*Builder) String

func (b *Builder) String() string

func (*Builder) Truncate

func (b *Builder) Truncate(n int) *Builder

func (*Builder) Write

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

func (*Builder) WriteByte

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

func (*Builder) WriteFormat

func (b *Builder) WriteFormat(format string, args ...interface{}) *Builder

func (*Builder) WriteString

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

func (*Builder) WriteStringer

func (b *Builder) WriteStringer(s ...fmt.Stringer) *Builder

type NameStyle

type NameStyle int
const (
	Pascal NameStyle = iota
	Camel
	Upper
	Lower
)

Jump to

Keyboard shortcuts

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