Documentation ¶
Overview ¶
Package strings provides a mockable wrapper for strings.
Index ¶
- type Impl
- func (*Impl) Clone(s string) string
- func (*Impl) Compare(a string, b string) int
- func (*Impl) Contains(s string, substr string) bool
- func (*Impl) ContainsAny(s string, chars string) bool
- func (*Impl) ContainsRune(s string, r rune) bool
- func (*Impl) Count(s string, substr string) int
- func (*Impl) Cut(s string, sep string) (before string, after string, found bool)
- func (*Impl) EqualFold(s string, t string) bool
- func (*Impl) Fields(s string) []string
- func (*Impl) FieldsFunc(s string, f func(rune) bool) []string
- func (*Impl) HasPrefix(s string, prefix string) bool
- func (*Impl) HasSuffix(s string, suffix string) bool
- func (*Impl) Index(s string, substr string) int
- func (*Impl) IndexAny(s string, chars string) int
- func (*Impl) IndexByte(s string, c byte) int
- func (*Impl) IndexFunc(s string, f func(rune) bool) int
- func (*Impl) IndexRune(s string, r rune) int
- func (*Impl) Join(elems []string, sep string) string
- func (*Impl) LastIndex(s string, substr string) int
- func (*Impl) LastIndexAny(s string, chars string) int
- func (*Impl) LastIndexByte(s string, c byte) int
- func (*Impl) LastIndexFunc(s string, f func(rune) bool) int
- func (*Impl) Map(mapping func(rune) rune, s string) string
- func (*Impl) NewReader(s string) *strings.Reader
- func (*Impl) NewReplacer(oldnew ...string) *strings.Replacer
- func (*Impl) Repeat(s string, count int) string
- func (*Impl) Replace(s string, old string, new string, n int) string
- func (*Impl) ReplaceAll(s string, old string, new string) string
- func (*Impl) Split(s string, sep string) []string
- func (*Impl) SplitAfter(s string, sep string) []string
- func (*Impl) SplitAfterN(s string, sep string, n int) []string
- func (*Impl) SplitN(s string, sep string, n int) []string
- func (*Impl) Title(s string) string
- func (*Impl) ToLower(s string) string
- func (*Impl) ToLowerSpecial(c unicode.SpecialCase, s string) string
- func (*Impl) ToTitle(s string) string
- func (*Impl) ToTitleSpecial(c unicode.SpecialCase, s string) string
- func (*Impl) ToUpper(s string) string
- func (*Impl) ToUpperSpecial(c unicode.SpecialCase, s string) string
- func (*Impl) ToValidUTF8(s string, replacement string) string
- func (*Impl) Trim(s string, cutset string) string
- func (*Impl) TrimFunc(s string, f func(rune) bool) string
- func (*Impl) TrimLeft(s string, cutset string) string
- func (*Impl) TrimLeftFunc(s string, f func(rune) bool) string
- func (*Impl) TrimPrefix(s string, prefix string) string
- func (*Impl) TrimRight(s string, cutset string) string
- func (*Impl) TrimRightFunc(s string, f func(rune) bool) string
- func (*Impl) TrimSpace(s string) string
- func (*Impl) TrimSuffix(s string, suffix string) string
- type Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Impl ¶
type Impl struct{}
func (*Impl) ToLowerSpecial ¶
func (*Impl) ToLowerSpecial(c unicode.SpecialCase, s string) string
func (*Impl) ToTitleSpecial ¶
func (*Impl) ToTitleSpecial(c unicode.SpecialCase, s string) string
func (*Impl) ToUpperSpecial ¶
func (*Impl) ToUpperSpecial(c unicode.SpecialCase, s 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 }
Click to show internal directories.
Click to hide internal directories.