Documentation ¶
Overview ¶
Package aghstrings contains utilities dealing with strings.
Index ¶
- func CloneSlice(a []string) (b []string)
- func CloneSliceOrEmpty(a []string) (b []string)
- func FilterOut(strs []string, f func(s string) (ok bool)) (filtered []string)
- func InSlice(strs []string, str string) (ok bool)
- func IsCommentOrEmpty(s string) (ok bool)
- func SplitNext(s *string, sep rune) (chunk string)
- func WriteToBuilder(b *strings.Builder, strs ...string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneSliceOrEmpty ¶
CloneSliceOrEmpty returns the copy of a or empty strings slice if a is nil.
func FilterOut ¶
FilterOut returns a copy of strs with all strings for which f returned true removed.
func IsCommentOrEmpty ¶
IsCommentOrEmpty returns true of the string starts with a "#" character or is an empty string.
func SplitNext ¶
SplitNext splits string by a byte and returns the first chunk skipping empty ones. Whitespaces are trimmed.
func WriteToBuilder ¶
WriteToBuilder is a convenient wrapper for strings.(*Builder).WriteString that deals with multiple strings and ignores errors that are guaranteed to be nil.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.