strings

Imports

Imports #

"internal/bytealg"
"internal/stringslite"
"math/bits"
"unicode"
"unicode/utf8"
"internal/abi"
"internal/bytealg"
"unicode/utf8"
"unsafe"
"internal/stringslite"
"internal/bytealg"
"iter"
"unicode"
"unicode/utf8"
"errors"
"io"
"unicode/utf8"
"io"
"sync"

Constants & Variables

asciiSpace var #

var asciiSpace = [256]uint8{...}

countCutOff const #

countCutOff controls the ratio of a string length to a number of replacements at which (*byteStringReplacer).Replace switches algorithms. For strings with higher ration of length to replacements than that value, we call Count, for each replacement from toReplace. For strings, with a lower ratio we use simple loop, because of Count overhead. countCutOff is an empirically determined overhead multiplier. TODO(tocarip) revisit once we have register-based abi/mid-stack inlining.

const countCutOff = 8

maxInt const #

const maxInt = *ast.CallExpr

repeatedDashes const #

According to static analysis, spaces, dashes, zeros, equals, and tabs are the most commonly repeated string literal, often used for display on fixed-width terminal windows. Pre-declare constants for these for O(1) repetition in the common-case.

const repeatedDashes = *ast.BinaryExpr

repeatedEquals const #

According to static analysis, spaces, dashes, zeros, equals, and tabs are the most commonly repeated string literal, often used for display on fixed-width terminal windows. Pre-declare constants for these for O(1) repetition in the common-case.

const repeatedEquals = *ast.BinaryExpr

repeatedSpaces const #

According to static analysis, spaces, dashes, zeros, equals, and tabs are the most commonly repeated string literal, often used for display on fixed-width terminal windows. Pre-declare constants for these for O(1) repetition in the common-case.

const repeatedSpaces = *ast.BinaryExpr

repeatedTabs const #

According to static analysis, spaces, dashes, zeros, equals, and tabs are the most commonly repeated string literal, often used for display on fixed-width terminal windows. Pre-declare constants for these for O(1) repetition in the common-case.

const repeatedTabs = *ast.BinaryExpr

repeatedZeroes const #

According to static analysis, spaces, dashes, zeros, equals, and tabs are the most commonly repeated string literal, often used for display on fixed-width terminal windows. Pre-declare constants for these for O(1) repetition in the common-case.

const repeatedZeroes = *ast.BinaryExpr

Type Aliases

appendSliceWriter type #

type appendSliceWriter []byte

asciiSet type #

asciiSet is a 32-byte value, where each bit represents the presence of a given ASCII character in the set. The 128-bits of the lower 16 bytes, starting with the least-significant bit of the lowest word to the most-significant bit of the highest word, map to the full range of all 128 ASCII characters. The 128-bits of the upper 16 bytes will be zeroed, ensuring that any non-ASCII character will be reported as not in the set. This allocates a total of 32 bytes even though the upper half is unused to avoid bounds checks in asciiSet.contains.

type asciiSet [8]uint32

byteReplacer type #

byteReplacer is the implementation that's used when all the "old" and "new" values are single ASCII bytes. The array contains replacement bytes indexed by old byte.

type byteReplacer [256]byte

Interfaces

replacer interface #

replacer is the interface that a replacement algorithm needs to implement.

type replacer interface {
Replace(s string) string
WriteString(w io.Writer, s string) (n int, err error)
}

Structs

Builder struct #

A Builder is used to efficiently build a string using [Builder.Write] methods. It minimizes memory copying. The zero value is ready to use. Do not copy a non-zero Builder.

type Builder struct {
addr *Builder
buf []byte
}

Reader struct #

A Reader implements the [io.Reader], [io.ReaderAt], [io.ByteReader], [io.ByteScanner], [io.RuneReader], [io.RuneScanner], [io.Seeker], and [io.WriterTo] interfaces by reading from a string. The zero value for Reader operates like a Reader of an empty string.

type Reader struct {
s string
i int64
prevRune int
}

Replacer struct #

Replacer replaces a list of strings with replacements. It is safe for concurrent use by multiple goroutines.

type Replacer struct {
once sync.Once
r replacer
oldnew []string
}

byteStringReplacer struct #

byteStringReplacer is the implementation that's used when all the "old" values are single ASCII bytes but the "new" values vary in size.

type byteStringReplacer struct {
replacements [256][]byte
toReplace []string
}

genericReplacer struct #

genericReplacer is the fully generic algorithm. It's used as a fallback when nothing faster can be used.

type genericReplacer struct {
root trieNode
tableSize int
mapping [256]byte
}

singleStringReplacer struct #

singleStringReplacer is the implementation that's used when there is only one string to replace (and that string has more than one byte).

type singleStringReplacer struct {
finder *stringFinder
value string
}

stringFinder struct #

stringFinder efficiently finds strings in a source text. It's implemented using the Boyer-Moore string search algorithm: https://en.wikipedia.org/wiki/Boyer-Moore_string_search_algorithm https://www.cs.utexas.edu/~moore/publications/fstrpos.pdf (note: this aged document uses 1-based indexing)

type stringFinder struct {
pattern string
badCharSkip [256]int
goodSuffixSkip []int
}

stringWriter struct #

type stringWriter struct {
w io.Writer
}

trieNode struct #

trieNode is a node in a lookup trie for prioritized key/value pairs. Keys and values may be empty. For example, the trie containing keys "ax", "ay", "bcbc", "x" and "xy" could have eight nodes: n0 - n1 a- n2 .x+ n3 .y+ n4 b- n5 .cbc+ n6 x+ n7 .y+ n0 is the root node, and its children are n1, n4 and n6; n1's children are n2 and n3; n4's child is n5; n6's child is n7. Nodes n0, n1 and n4 (marked with a trailing "-") are partial keys, and nodes n2, n3, n5, n6 and n7 (marked with a trailing "+") are complete keys.

type trieNode struct {
value string
priority int
prefix string
next *trieNode
table []*trieNode
}

Functions

Cap method #

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 (b *Builder) Cap() int

Clone function #

Clone returns a fresh copy of s. It guarantees to make a copy of s into a new allocation, which can be important when retaining only a small substring of a much larger string. Using Clone can help such programs use less memory. Of course, since using Clone makes a copy, overuse of Clone can make programs use more memory. Clone should typically be used only rarely, and only when profiling indicates that it is needed. For strings of length zero the string "" will be returned and no allocation is made.

func Clone(s string) string

Compare function #

Compare returns an integer comparing two strings lexicographically. The result will be 0 if a == b, -1 if a < b, and +1 if a > b. Use Compare when you need to perform a three-way comparison (with [slices.SortFunc], for example). It is usually clearer and always faster to use the built-in string comparison operators ==, <, >, and so on.

func Compare(a string, b string) int

Contains function #

Contains reports whether substr is within s.

func Contains(s string, substr string) bool

ContainsAny function #

ContainsAny reports whether any Unicode code points in chars are within s.

func ContainsAny(s string, chars string) bool

ContainsFunc function #

ContainsFunc reports whether any Unicode code points r within s satisfy f(r).

func ContainsFunc(s string, f func(rune) bool) bool

ContainsRune function #

ContainsRune reports whether the Unicode code point r is within s.

func ContainsRune(s string, r rune) bool

Count function #

Count counts the number of non-overlapping instances of substr in s. If substr is an empty string, Count returns 1 + the number of Unicode code points in s.

func Count(s string, substr string) int

Cut function #

Cut slices s around the first instance of sep, returning the text before and after sep. The found result reports whether sep appears in s. If sep does not appear in s, cut returns s, "", false.

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

CutPrefix function #

CutPrefix returns s without the provided leading prefix string and reports whether it found the prefix. If s doesn't start with prefix, CutPrefix returns s, false. If prefix is the empty string, CutPrefix returns s, true.

func CutPrefix(s string, prefix string) (after string, found bool)

CutSuffix function #

CutSuffix returns s without the provided ending suffix string and reports whether it found the suffix. If s doesn't end with suffix, CutSuffix returns s, false. If suffix is the empty string, CutSuffix returns s, true.

func CutSuffix(s string, suffix string) (before string, found bool)

EqualFold function #

EqualFold reports whether s and t, interpreted as UTF-8 strings, are equal under simple Unicode case-folding, which is a more general form of case-insensitivity.

func EqualFold(s string, t string) bool

Fields function #

Fields splits the string s around each instance of one or more consecutive white space characters, as defined by [unicode.IsSpace], returning a slice of substrings of s or an empty slice if s contains only white space.

func Fields(s string) []string

FieldsFunc function #

FieldsFunc splits the string s at each run of Unicode code points c satisfying f(c) and returns an array of slices of s. If all code points in s satisfy f(c) or the string is empty, an empty slice is returned. FieldsFunc makes no guarantees about the order in which it calls f(c) and assumes that f always returns the same value for a given c.

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

FieldsFuncSeq function #

FieldsFuncSeq returns an iterator over substrings of s split around runs of Unicode code points satisfying f(c). The iterator yields the same strings that would be returned by [FieldsFunc](s), but without constructing the slice.

func FieldsFuncSeq(s string, f func(rune) bool) *ast.IndexExpr

FieldsSeq function #

FieldsSeq returns an iterator over substrings of s split around runs of whitespace characters, as defined by [unicode.IsSpace]. The iterator yields the same strings that would be returned by [Fields](s), but without constructing the slice.

func FieldsSeq(s string) *ast.IndexExpr

Grow method #

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 (b *Builder) Grow(n int)

HasPrefix function #

HasPrefix reports whether the string s begins with prefix.

func HasPrefix(s string, prefix string) bool

HasSuffix function #

HasSuffix reports whether the string s ends with suffix.

func HasSuffix(s string, suffix string) bool

Index function #

Index returns the index of the first instance of substr in s, or -1 if substr is not present in s.

func Index(s string, substr string) int

IndexAny function #

IndexAny returns the index of the first instance of any Unicode code point from chars in s, or -1 if no Unicode code point from chars is present in s.

func IndexAny(s string, chars string) int

IndexByte function #

IndexByte returns the index of the first instance of c in s, or -1 if c is not present in s.

func IndexByte(s string, c byte) int

IndexFunc function #

IndexFunc returns the index into s of the first Unicode code point satisfying f(c), or -1 if none do.

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

IndexRune function #

IndexRune returns the index of the first instance of the Unicode code point r, or -1 if rune is not present in s. If r is [utf8.RuneError], it returns the first instance of any invalid UTF-8 byte sequence.

func IndexRune(s string, r rune) int

Join function #

Join concatenates the elements of its first argument to create a single string. The separator string sep is placed between elements in the resulting string.

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

LastIndex function #

LastIndex returns the index of the last instance of substr in s, or -1 if substr is not present in s.

func LastIndex(s string, substr string) int

LastIndexAny function #

LastIndexAny returns the index of the last instance of any Unicode code point from chars in s, or -1 if no Unicode code point from chars is present in s.

func LastIndexAny(s string, chars string) int

LastIndexByte function #

LastIndexByte returns the index of the last instance of c in s, or -1 if c is not present in s.

func LastIndexByte(s string, c byte) int

LastIndexFunc function #

LastIndexFunc returns the index into s of the last Unicode code point satisfying f(c), or -1 if none do.

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

Len method #

Len returns the number of accumulated bytes; b.Len() == len(b.String()).

func (b *Builder) Len() int

Len method #

Len returns the number of bytes of the unread portion of the string.

func (r *Reader) Len() int

Lines function #

Lines returns an iterator over the newline-terminated lines in the string s. The lines yielded by the iterator include their terminating newlines. If s is empty, the iterator yields no lines at all. If s does not end in a newline, the final yielded line will not end in a newline. It returns a single-use iterator.

func Lines(s string) *ast.IndexExpr

Map function #

Map returns a copy of the string s with all its characters modified according to the mapping function. If mapping returns a negative value, the character is dropped from the string with no replacement.

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

NewReader function #

NewReader returns a new [Reader] reading from s. It is similar to [bytes.NewBufferString] but more efficient and non-writable.

func NewReader(s string) *Reader

NewReplacer function #

NewReplacer returns a new [Replacer] from a list of old, new string pairs. Replacements are performed in the order they appear in the target string, without overlapping matches. The old string comparisons are done in argument order. NewReplacer panics if given an odd number of arguments.

func NewReplacer(oldnew ...string) *Replacer

Read method #

Read implements the [io.Reader] interface.

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

ReadAt method #

ReadAt implements the [io.ReaderAt] interface.

func (r *Reader) ReadAt(b []byte, off int64) (n int, err error)

ReadByte method #

ReadByte implements the [io.ByteReader] interface.

func (r *Reader) ReadByte() (byte, error)

ReadRune method #

ReadRune implements the [io.RuneReader] interface.

func (r *Reader) ReadRune() (ch rune, size int, err error)

Repeat function #

Repeat returns a new string consisting of count copies of the string s. It panics if count is negative or if the result of (len(s) * count) overflows.

func Repeat(s string, count int) string

Replace function #

Replace returns a copy of the string s with the first n non-overlapping instances of old replaced by new. If old is empty, it matches at the beginning of the string and after each UTF-8 sequence, yielding up to k+1 replacements for a k-rune string. If n < 0, there is no limit on the number of replacements.

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

Replace method #

func (r *byteReplacer) Replace(s string) string

Replace method #

Replace returns a copy of s with all replacements performed.

func (r *Replacer) Replace(s string) string

Replace method #

func (r *byteStringReplacer) Replace(s string) string

Replace method #

func (r *genericReplacer) Replace(s string) string

Replace method #

func (r *singleStringReplacer) Replace(s string) string

ReplaceAll function #

ReplaceAll returns a copy of the string s with all non-overlapping instances of old replaced by new. If old is empty, it matches at the beginning of the string and after each UTF-8 sequence, yielding up to k+1 replacements for a k-rune string.

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

Reset method #

Reset resets the [Builder] to be empty.

func (b *Builder) Reset()

Reset method #

Reset resets the [Reader] to be reading from s.

func (r *Reader) Reset(s string)

Seek method #

Seek implements the [io.Seeker] interface.

func (r *Reader) Seek(offset int64, whence int) (int64, error)

Size method #

Size returns the original length of the underlying string. Size is the number of bytes available for reading via [Reader.ReadAt]. The returned value is always the same and is not affected by calls to any other method.

func (r *Reader) Size() int64

Split function #

Split slices s into all substrings separated by sep and returns a slice of the substrings between those separators. If s does not contain sep and sep is not empty, Split returns a slice of length 1 whose only element is s. If sep is empty, Split splits after each UTF-8 sequence. If both s and sep are empty, Split returns an empty slice. It is equivalent to [SplitN] with a count of -1. To split around the first instance of a separator, see [Cut].

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

SplitAfter function #

SplitAfter slices s into all substrings after each instance of sep and returns a slice of those substrings. If s does not contain sep and sep is not empty, SplitAfter returns a slice of length 1 whose only element is s. If sep is empty, SplitAfter splits after each UTF-8 sequence. If both s and sep are empty, SplitAfter returns an empty slice. It is equivalent to [SplitAfterN] with a count of -1.

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

SplitAfterN function #

SplitAfterN slices s into substrings after each instance of sep and returns a slice of those substrings. The count determines the number of substrings to return: - n > 0: at most n substrings; the last substring will be the unsplit remainder; - n == 0: the result is nil (zero substrings); - n < 0: all substrings. Edge cases for s and sep (for example, empty strings) are handled as described in the documentation for [SplitAfter].

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

SplitAfterSeq function #

SplitAfterSeq returns an iterator over substrings of s split after each instance of sep. The iterator yields the same strings that would be returned by [SplitAfter](s, sep), but without constructing the slice. It returns a single-use iterator.

func SplitAfterSeq(s string, sep string) *ast.IndexExpr

SplitN function #

SplitN slices s into substrings separated by sep and returns a slice of the substrings between those separators. The count determines the number of substrings to return: - n > 0: at most n substrings; the last substring will be the unsplit remainder; - n == 0: the result is nil (zero substrings); - n < 0: all substrings. Edge cases for s and sep (for example, empty strings) are handled as described in the documentation for [Split]. To split around the first instance of a separator, see [Cut].

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

SplitSeq function #

SplitSeq returns an iterator over all substrings of s separated by sep. The iterator yields the same strings that would be returned by [Split](s, sep), but without constructing the slice. It returns a single-use iterator.

func SplitSeq(s string, sep string) *ast.IndexExpr

String method #

String returns the accumulated string.

func (b *Builder) String() string

Title function #

Title returns a copy of the string s with all Unicode letters that begin words mapped to their Unicode title case. Deprecated: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.

func Title(s string) string

ToLower function #

ToLower returns s with all Unicode letters mapped to their lower case.

func ToLower(s string) string

ToLowerSpecial function #

ToLowerSpecial returns a copy of the string s with all Unicode letters mapped to their lower case using the case mapping specified by c.

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

ToTitle function #

ToTitle returns a copy of the string s with all Unicode letters mapped to their Unicode title case.

func ToTitle(s string) string

ToTitleSpecial function #

ToTitleSpecial returns a copy of the string s with all Unicode letters mapped to their Unicode title case, giving priority to the special casing rules.

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

ToUpper function #

ToUpper returns s with all Unicode letters mapped to their upper case.

func ToUpper(s string) string

ToUpperSpecial function #

ToUpperSpecial returns a copy of the string s with all Unicode letters mapped to their upper case using the case mapping specified by c.

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

ToValidUTF8 function #

ToValidUTF8 returns a copy of the string s with each run of invalid UTF-8 byte sequences replaced by the replacement string, which may be empty.

func ToValidUTF8(s string, replacement string) string

Trim function #

Trim returns a slice of the string s with all leading and trailing Unicode code points contained in cutset removed.

func Trim(s string, cutset string) string

TrimFunc function #

TrimFunc returns a slice of the string s with all leading and trailing Unicode code points c satisfying f(c) removed.

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

TrimLeft function #

TrimLeft returns a slice of the string s with all leading Unicode code points contained in cutset removed. To remove a prefix, use [TrimPrefix] instead.

func TrimLeft(s string, cutset string) string

TrimLeftFunc function #

TrimLeftFunc returns a slice of the string s with all leading Unicode code points c satisfying f(c) removed.

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

TrimPrefix function #

TrimPrefix returns s without the provided leading prefix string. If s doesn't start with prefix, s is returned unchanged.

func TrimPrefix(s string, prefix string) string

TrimRight function #

TrimRight returns a slice of the string s, with all trailing Unicode code points contained in cutset removed. To remove a suffix, use [TrimSuffix] instead.

func TrimRight(s string, cutset string) string

TrimRightFunc function #

TrimRightFunc returns a slice of the string s with all trailing Unicode code points c satisfying f(c) removed.

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

TrimSpace function #

TrimSpace returns a slice of the string s, with all leading and trailing white space removed, as defined by Unicode.

func TrimSpace(s string) string

TrimSuffix function #

TrimSuffix returns s without the provided trailing suffix string. If s doesn't end with suffix, s is returned unchanged.

func TrimSuffix(s string, suffix string) string

UnreadByte method #

UnreadByte implements the [io.ByteScanner] interface.

func (r *Reader) UnreadByte() error

UnreadRune method #

UnreadRune implements the [io.RuneScanner] interface.

func (r *Reader) UnreadRune() error

Write method #

Write appends the contents of p to b's buffer. Write always returns len(p), nil.

func (b *Builder) Write(p []byte) (int, error)

Write method #

Write writes to the buffer to satisfy [io.Writer].

func (w *appendSliceWriter) Write(p []byte) (int, error)

WriteByte method #

WriteByte appends the byte c to b's buffer. The returned error is always nil.

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

WriteRune method #

WriteRune appends the UTF-8 encoding of Unicode code point r to b's buffer. It returns the length of r and a nil error.

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

WriteString method #

WriteString writes to the buffer without string->[]byte->string allocations.

func (w *appendSliceWriter) WriteString(s string) (int, error)

WriteString method #

func (w stringWriter) WriteString(s string) (int, error)

WriteString method #

func (r *genericReplacer) WriteString(w io.Writer, s string) (n int, err error)

WriteString method #

WriteString appends the contents of s to b's buffer. It returns the length of s and a nil error.

func (b *Builder) WriteString(s string) (int, error)

WriteString method #

func (r *singleStringReplacer) WriteString(w io.Writer, s string) (n int, err error)

WriteString method #

WriteString writes s to w with all replacements performed.

func (r *Replacer) WriteString(w io.Writer, s string) (n int, err error)

WriteString method #

func (r *byteReplacer) WriteString(w io.Writer, s string) (n int, err error)

WriteString method #

func (r *byteStringReplacer) WriteString(w io.Writer, s string) (n int, err error)

WriteTo method #

WriteTo implements the [io.WriterTo] interface.

func (r *Reader) WriteTo(w io.Writer) (n int64, err error)

add method #

func (t *trieNode) add(key string, val string, priority int, r *genericReplacer)

build method #

func (b *Replacer) build() replacer

buildOnce method #

func (r *Replacer) buildOnce()

contains method #

contains reports whether c is inside the set.

func (as *asciiSet) contains(c byte) bool

copyCheck method #

func (b *Builder) copyCheck()

explode function #

explode splits s into a slice of UTF-8 strings, one string per Unicode character up to a maximum of n (n < 0 means no limit). Invalid UTF-8 bytes are sliced individually.

func explode(s string, n int) []string

explodeSeq function #

explodeSeq returns an iterator over the runes in s.

func explodeSeq(s string) *ast.IndexExpr

genSplit function #

Generic split: splits after each instance of sep, including sepSave bytes of sep in the subarrays.

func genSplit(s string, sep string, sepSave int, n int) []string

getStringWriter function #

func getStringWriter(w io.Writer) io.StringWriter

grow method #

grow copies the buffer to a new, larger buffer so that there are at least n bytes of capacity beyond len(b.buf).

func (b *Builder) grow(n int)

indexFunc function #

indexFunc is the same as IndexFunc except that if truth==false, the sense of the predicate function is inverted.

func indexFunc(s string, f func(rune) bool, truth bool) int

isSeparator function #

isSeparator reports whether the rune could mark a word boundary. TODO: update when package unicode captures more of the properties.

func isSeparator(r rune) bool

lastIndexFunc function #

lastIndexFunc is the same as LastIndexFunc except that if truth==false, the sense of the predicate function is inverted.

func lastIndexFunc(s string, f func(rune) bool, truth bool) int

longestCommonSuffix function #

func longestCommonSuffix(a string, b string) (i int)

lookup method #

func (r *genericReplacer) lookup(s string, ignoreRoot bool) (val string, keylen int, found bool)

makeASCIISet function #

makeASCIISet creates a set of ASCII characters and reports whether all characters in chars are ASCII.

func makeASCIISet(chars string) (as asciiSet, ok bool)

makeGenericReplacer function #

func makeGenericReplacer(oldnew []string) *genericReplacer

makeSingleStringReplacer function #

func makeSingleStringReplacer(pattern string, value string) *singleStringReplacer

makeStringFinder function #

func makeStringFinder(pattern string) *stringFinder

next method #

next returns the index in text of the first occurrence of the pattern. If the pattern is not found, it returns -1.

func (f *stringFinder) next(text string) int

splitSeq function #

splitSeq is SplitSeq or SplitAfterSeq, configured by how many bytes of sep to include in the results (none or all).

func splitSeq(s string, sep string, sepSave int) *ast.IndexExpr

trimLeftASCII function #

func trimLeftASCII(s string, as *asciiSet) string

trimLeftByte function #

func trimLeftByte(s string, c byte) string

trimLeftUnicode function #

func trimLeftUnicode(s string, cutset string) string

trimRightASCII function #

func trimRightASCII(s string, as *asciiSet) string

trimRightByte function #

func trimRightByte(s string, c byte) string

trimRightUnicode function #

func trimRightUnicode(s string, cutset string) string

Generated with Arrow