MCPcopy Create free account
hub / github.com/tendermint/tendermint / SplitAndTrim

Function SplitAndTrim

libs/strings/string.go:46–56  ·  view source on GitHub ↗

SplitAndTrim slices s into all subslices separated by sep and returns a slice of the string s with all leading and trailing Unicode code points contained in cutset removed. If sep is empty, SplitAndTrim splits after each UTF-8 sequence. First part is equivalent to strings.SplitN with a count of -1.

(s, sep, cutset string)

Source from the content-addressed store, hash-verified

44// UTF-8 sequence. First part is equivalent to strings.SplitN with a count of
45// -1.
46func SplitAndTrim(s, sep, cutset string) []string {
47 if s == "" {
48 return []string{}
49 }
50
51 spl := strings.Split(s, sep)
52 for i := 0; i < len(spl); i++ {
53 spl[i] = strings.Trim(spl[i], cutset)
54 }
55 return spl
56}
57
58// Returns true if s is a non-empty printable non-tab ascii character.
59func IsASCIIText(s string) bool {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…