Documentation ¶
Index ¶
- type StringSet
- func (r *StringSet) AllContains(substr string) bool
- func (r *StringSet) AllPrefix(prefix string) bool
- func (r *StringSet) AllSuffix(suffix string) bool
- func (r *StringSet) AnyContains(substr string) bool
- func (r *StringSet) AnyPrefix(prefix string) bool
- func (r *StringSet) AnySuffix(suffix string) bool
- func (r *StringSet) Append(parts ...string) *StringSet
- func (r *StringSet) Get(pos int) string
- func (r *StringSet) Has(part string) bool
- func (r *StringSet) Join(glue string) *StringSet
- func (r *StringSet) Length() int
- func (r *StringSet) Lengths() []int
- func (r *StringSet) Prepend(parts ...string) *StringSet
- func (r *StringSet) RemoveEmpty() *StringSet
- func (r *StringSet) Size() int
- func (r *StringSet) Split(separator string) *StringSet
- func (r *StringSet) String() string
- func (r *StringSet) Strings() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StringSet ¶
type StringSet []string
StringSet defines a collection of strings and provides useful functions to work with.
func New ¶
New creates a new stringSet. Insert the parts (strings) to the stringSet as parameter 'parts'.
func (*StringSet) AllContains ¶
AllContains returns true, when all strings contain the parameter 'substr'.
func (*StringSet) AllPrefix ¶
AllPrefix returns true, when all strings have the parameter 'prefix' as prefix.
func (*StringSet) AllSuffix ¶
AllSuffix returns true, when all strings have the parameter 'suffix' as suffix.
func (*StringSet) AnyContains ¶
AnyContains returns true, when any string exists, which contains the parameter 'substr'.
func (*StringSet) AnyPrefix ¶
AnyPrefix returns true, when any string exists, which has the parameter 'prefix' as prefix.
func (*StringSet) AnySuffix ¶
AnySuffix returns true, when any string exists, which has the parameter 'suffix' as suffix.
func (*StringSet) Get ¶
Get returns the part at the position 'pos'. If 'pos' is invalid, it returns an empty string.
func (*StringSet) Join ¶
Join joins all parts together with 'glue' between. The result is a stringSet with only one string.
func (*StringSet) RemoveEmpty ¶
RemoveEmpty removes all empty strings of the stringSet.
func (*StringSet) Split ¶
Split splits all parts of the stringSet and adds them to the stringSet. E.g. if you have a,b and c,d and split by ",", you will have the four strings a, b, c and d in your stringSet.