Documentation
¶
Index ¶
- func Join[T ~string](elems []T, sep string) string
- func Pointer[T ~string](s T) *Tdeprecated
- func RepeatJoin[T ~string](s T, count int, sep string) string
- func RepeatSlice[T ~string](s T, count int) []string
- func ScanTokens(s string) []string
- func Search[T ~string](a []T, x T) int
- func SliceHas[T ~string](a []T, x T) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Join ¶
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.
This is a copy of Go's strings.Join but uses generic type for the elements.
func RepeatJoin ¶
RepeatJoin returns a string consisting of count copies of the string s concatenated using the separate string sep. This is similar as using RepeatSlice together with Go's strings.Join. Panics when count is negative.
func RepeatSlice ¶
RepeatSlice returns a []string consisting of count copies of the string s. When count is zero, empty slice is returned. Panics when count is out of range when making slice.
func ScanTokens ¶ added in v1.9.0
ScanTokens scans a string and returns a slice of tokens.
Tokens are separated by whitespace, unless they are within quotes. If a token is within quotes, the whitespace is preserved within the token. Any character that is not whitespace or a quote is part of a token.
Types ¶
This section is empty.