strings

package
v0.0.0-...-4cc5765 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Basename

func Basename(path string) string

func Escape

func Escape(str string) string

quote a Go literal string

func IndexByte

func IndexByte(str string, b byte) int

return the offset of the first byte == b in str, or -1 if str does not contain b

func Int64ToString

func Int64ToString(i int64) string

func IntToString

func IntToString(n int) string

func LastIndexByte

func LastIndexByte(str string, b byte) int

return the offset of the last byte == b in str, or -1 if str does not contain b

func ToLower

func ToLower(str string) string

convert ASCII uppercase letters to lowercase

func Uint64ToString

func Uint64ToString(n uint64) string

func UintToString

func UintToString(n uint) string

func Unescape

func Unescape(str string) string

interpret \ inside a Go literal string

func WriteQualifiedName

func WriteQualifiedName(out io.StringWriter, name string, pkgPath string, flag Verbose)

func WriteQuotedString

func WriteQuotedString(out io.StringWriter, str string)

quote a Go literal string and write it to out

Types

type Builder

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

reduced version of strings.Builder

func (*Builder) Grow

func (b *Builder) Grow(n int)

func (*Builder) Len

func (b *Builder) Len() int

func (*Builder) Reset

func (b *Builder) Reset()

func (*Builder) String

func (b *Builder) String() string

func (*Builder) WriteByte

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

func (*Builder) WriteRune

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

func (*Builder) WriteString

func (b *Builder) WriteString(str string) (n int, err error)

type Reader

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

Reduced version of strings.Reader, implements only io.Reader by reading from a string. The zero value is a Reader of an empty string.

func NewReader

func NewReader(str string) *Reader

return a new Reader reading from specified string str.

func (*Reader) Read

func (r *Reader) Read(p []byte) (n int, err error)

func (*Reader) Reset

func (r *Reader) Reset(str string)

type Verbose

type Verbose bool
const (
	ShortPkgName Verbose = false
	FullPkgPath  Verbose = true
)

Jump to

Keyboard shortcuts

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