stringutil

package
v1.13.9 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: Apache-2.0 Imports: 1 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Concat

func Concat(parts ...string) string

Concat concatenates parts of a string together.

func Diff

func Diff(new, old []string) (add, del []string)

Diff calculates difference of two sorted string (in ASC order).

func String

func String(b []byte) string

String returns a string value whose underlying bytes is b.

Since Go strings are immutable, the bytes passed to String must not be modified afterwards.

Types

type Builder

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

Builder concatenates parts of a string together.

func NewBuilder

func NewBuilder(b []byte) *Builder

NewBuilder creates a new Builder object.

func NewBuilderSize

func NewBuilderSize(ncap int) *Builder

NewBuilderSize creates a new Builder object whose buffer has at least the specified size.

func (*Builder) Add

func (p *Builder) Add(s string) *Builder

Add appends a string part.

func (*Builder) AddByte

func (p *Builder) AddByte(s ...byte) *Builder

AddByte appends a bytes string part.

func (*Builder) Build

func (p *Builder) Build() string

Build concatenates parts of a string together and returns it.

Jump to

Keyboard shortcuts

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