Documentation ¶
Index ¶
- Variables
- func Addr2Hex(str string) (string, error)
- func AnyBlank(ss []string) bool
- func Append(ss ...string) string
- func Contain(ss []string, str string) bool
- func Contains(list []string, str string) bool
- func Copy(s string) string
- func Diff(base, exclude []string) (result []string)
- func Filter(ss []string, str string) (dt []string)
- func Find(ss []string, str string) int
- func HasEmpty(args ...string) bool
- func Hex2Addr(str string) (string, error)
- func NotEmpty(args ...string) bool
- func Rand() string
- func RandId() string
- func Randn(n int) string
- func Remove(ss []string, s string) (result []string)
- func Reverse(s string) string
- func Seed(seed int64)
- func SubStr(s string, start, length int) string
- func Substr(str string, start int, stop int) (string, error)
- func TakeOne(valid, or string) string
- func TakeWithPriority(fns ...func() string) string
- func Ternary(s1, s2 string) string
- func ToBytes(str string) []byte
- func ToFloat64(s string) (float64, error)
- func ToInt(s string) (int, error)
- func ToInt64(str string) (int64, error)
- func Union(first, second []string) []string
- func Unique(ss []string) (result []string)
- type Builder
- func (b *Builder) Append(ss ...string)
- func (b *Builder) Cap() int
- func (b *Builder) Grow(n int)
- func (b *Builder) Len() int
- func (b *Builder) Reset()
- func (b *Builder) String() string
- func (b *Builder) Write(p []byte) (int, error)
- func (b *Builder) WriteByte(c byte) error
- func (b *Builder) WriteRune(r rune) (int, error)
- func (b *Builder) WriteString(s string) (int, error)
- type Strings
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidStartPosition = errors.New("start position is invalid") ErrInvalidStopPosition = errors.New("stop position is invalid") )
Functions ¶
func Substr ¶
Substr returns runes between start and stop [start, stop) regardless of the chars are ascii or utf8
func TakeWithPriority ¶
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
A Builder is used to efficiently build a string using Write methods. It minimizes memory copying. The zero value is ready to use. Do not copy a non-zero Builder.
func GetBuilder ¶
func GetBuilder() *Builder
func (*Builder) Cap ¶
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 ¶
Grow grows b's capacity, if necessary, to guarantee space for another n bytes. After Grow(n), at least n bytes can be written to b without another allocation. If n is negative, Grow panics.
func (*Builder) Write ¶
Write appends the contents of p to b's buffer. Write always returns len(p), nil.
func (*Builder) WriteByte ¶
WriteByte appends the byte c to b's buffer. The returned error is always nil.