strings

package
v0.0.0-...-fab57c2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package strings provides a mockable wrapper for strings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Impl

type Impl struct{}

func (*Impl) Clone

func (*Impl) Clone(s string) string

func (*Impl) Compare

func (*Impl) Compare(a string, b string) int

func (*Impl) Contains

func (*Impl) Contains(s string, substr string) bool

func (*Impl) ContainsAny

func (*Impl) ContainsAny(s string, chars string) bool

func (*Impl) ContainsRune

func (*Impl) ContainsRune(s string, r rune) bool

func (*Impl) Count

func (*Impl) Count(s string, substr string) int

func (*Impl) Cut

func (*Impl) Cut(s string, sep string) (before string, after string, found bool)

func (*Impl) EqualFold

func (*Impl) EqualFold(s string, t string) bool

func (*Impl) Fields

func (*Impl) Fields(s string) []string

func (*Impl) FieldsFunc

func (*Impl) FieldsFunc(s string, f func(rune) bool) []string

func (*Impl) HasPrefix

func (*Impl) HasPrefix(s string, prefix string) bool

func (*Impl) HasSuffix

func (*Impl) HasSuffix(s string, suffix string) bool

func (*Impl) Index

func (*Impl) Index(s string, substr string) int

func (*Impl) IndexAny

func (*Impl) IndexAny(s string, chars string) int

func (*Impl) IndexByte

func (*Impl) IndexByte(s string, c byte) int

func (*Impl) IndexFunc

func (*Impl) IndexFunc(s string, f func(rune) bool) int

func (*Impl) IndexRune

func (*Impl) IndexRune(s string, r rune) int

func (*Impl) Join

func (*Impl) Join(elems []string, sep string) string

func (*Impl) LastIndex

func (*Impl) LastIndex(s string, substr string) int

func (*Impl) LastIndexAny

func (*Impl) LastIndexAny(s string, chars string) int

func (*Impl) LastIndexByte

func (*Impl) LastIndexByte(s string, c byte) int

func (*Impl) LastIndexFunc

func (*Impl) LastIndexFunc(s string, f func(rune) bool) int

func (*Impl) Map

func (*Impl) Map(mapping func(rune) rune, s string) string

func (*Impl) NewReader

func (*Impl) NewReader(s string) *strings.Reader

func (*Impl) NewReplacer

func (*Impl) NewReplacer(oldnew ...string) *strings.Replacer

func (*Impl) Repeat

func (*Impl) Repeat(s string, count int) string

func (*Impl) Replace

func (*Impl) Replace(s string, old string, new string, n int) string

func (*Impl) ReplaceAll

func (*Impl) ReplaceAll(s string, old string, new string) string

func (*Impl) Split

func (*Impl) Split(s string, sep string) []string

func (*Impl) SplitAfter

func (*Impl) SplitAfter(s string, sep string) []string

func (*Impl) SplitAfterN

func (*Impl) SplitAfterN(s string, sep string, n int) []string

func (*Impl) SplitN

func (*Impl) SplitN(s string, sep string, n int) []string

func (*Impl) Title

func (*Impl) Title(s string) string

func (*Impl) ToLower

func (*Impl) ToLower(s string) string

func (*Impl) ToLowerSpecial

func (*Impl) ToLowerSpecial(c unicode.SpecialCase, s string) string

func (*Impl) ToTitle

func (*Impl) ToTitle(s string) string

func (*Impl) ToTitleSpecial

func (*Impl) ToTitleSpecial(c unicode.SpecialCase, s string) string

func (*Impl) ToUpper

func (*Impl) ToUpper(s string) string

func (*Impl) ToUpperSpecial

func (*Impl) ToUpperSpecial(c unicode.SpecialCase, s string) string

func (*Impl) ToValidUTF8

func (*Impl) ToValidUTF8(s string, replacement string) string

func (*Impl) Trim

func (*Impl) Trim(s string, cutset string) string

func (*Impl) TrimFunc

func (*Impl) TrimFunc(s string, f func(rune) bool) string

func (*Impl) TrimLeft

func (*Impl) TrimLeft(s string, cutset string) string

func (*Impl) TrimLeftFunc

func (*Impl) TrimLeftFunc(s string, f func(rune) bool) string

func (*Impl) TrimPrefix

func (*Impl) TrimPrefix(s string, prefix string) string

func (*Impl) TrimRight

func (*Impl) TrimRight(s string, cutset string) string

func (*Impl) TrimRightFunc

func (*Impl) TrimRightFunc(s string, f func(rune) bool) string

func (*Impl) TrimSpace

func (*Impl) TrimSpace(s string) string

func (*Impl) TrimSuffix

func (*Impl) TrimSuffix(s string, suffix string) string

type Interface

type Interface interface {
	Clone(s string) string
	Compare(a string, b string) int
	Contains(s string, substr string) bool
	ContainsAny(s string, chars string) bool
	ContainsRune(s string, r rune) bool
	Count(s string, substr string) int
	Cut(s string, sep string) (before string, after string, found bool)
	EqualFold(s string, t string) bool
	Fields(s string) []string
	FieldsFunc(s string, f func(rune) bool) []string
	HasPrefix(s string, prefix string) bool
	HasSuffix(s string, suffix string) bool
	Index(s string, substr string) int
	IndexAny(s string, chars string) int
	IndexByte(s string, c byte) int
	IndexFunc(s string, f func(rune) bool) int
	IndexRune(s string, r rune) int
	Join(elems []string, sep string) string
	LastIndex(s string, substr string) int
	LastIndexAny(s string, chars string) int
	LastIndexByte(s string, c byte) int
	LastIndexFunc(s string, f func(rune) bool) int
	Map(mapping func(rune) rune, s string) string
	NewReader(s string) *strings.Reader
	NewReplacer(oldnew ...string) *strings.Replacer
	Repeat(s string, count int) string
	Replace(s string, old string, new string, n int) string
	ReplaceAll(s string, old string, new string) string
	Split(s string, sep string) []string
	SplitAfter(s string, sep string) []string
	SplitAfterN(s string, sep string, n int) []string
	SplitN(s string, sep string, n int) []string
	Title(s string) string
	ToLower(s string) string
	ToLowerSpecial(c unicode.SpecialCase, s string) string
	ToTitle(s string) string
	ToTitleSpecial(c unicode.SpecialCase, s string) string
	ToUpper(s string) string
	ToUpperSpecial(c unicode.SpecialCase, s string) string
	ToValidUTF8(s string, replacement string) string
	Trim(s string, cutset string) string
	TrimFunc(s string, f func(rune) bool) string
	TrimLeft(s string, cutset string) string
	TrimLeftFunc(s string, f func(rune) bool) string
	TrimPrefix(s string, prefix string) string
	TrimRight(s string, cutset string) string
	TrimRightFunc(s string, f func(rune) bool) string
	TrimSpace(s string) string
	TrimSuffix(s string, suffix string) string
}

Jump to

Keyboard shortcuts

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