Package strutil contains string and byte processing functions.
Internal call graph ▹
Internal call graph ▾
In the call graph viewer below, each node is a function belonging to this package and its children are the functions it calls—perhaps dynamically.
The root nodes are the entry points of the package: functions that may be called from outside the package. There may be non-exported or anonymous functions among them if they are called dynamically from another package.
Click a node to visit that function's source code.
From there you can visit its callers by
clicking its declaring
Functions may be omitted if they were determined to be unreachable in the particular programs or tests that were analyzed.
func AppendSplitN ¶
func AppendSplitN(dst string, s, sep string, n int) string
AppendSplitN is like strings.SplitN but appends to and returns dst. Unlike strings.SplitN, an empty separator is not supported. The count n 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
func ContainsFold ¶
func ContainsFold(s, substr string) bool
ContainsFold is like strings.Contains but uses Unicode case-folding.
func HasPrefixFold ¶
func HasPrefixFold(s, prefix string) bool
HasPrefixFold is like strings.HasPrefix but uses Unicode case-folding.
func HasSuffixFold ¶
func HasSuffixFold(s, suffix string) bool
HasSuffixFold is like strings.HasPrefix but uses Unicode case-folding.
func IsPlausibleJSON ¶
func IsPlausibleJSON(s string) bool
IsPlausibleJSON reports whether s likely contains a JSON object, without actually parsing it. It's meant to be a light heuristic.
func ParseUintBytes ¶
func ParseUintBytes(s byte, base int, bitSize int) (n uint64, err error)
ParseUintBytes is like strconv.ParseUint, but using a byte.
func RegisterCommonString ¶
func RegisterCommonString(s ...string)
RegisterCommonString adds common strings to the interned string table. This should be called during init from the main goroutine, not later at runtime.
func StringFromBytes ¶
func StringFromBytes(v byte) string
StringFromBytes returns string(v), minimizing copies for common values of v as previously registered with RegisterCommonString.