stringset

package
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2021 License: Apache-2.0 Imports: 1 Imported by: 10

README

package stringset

Operations on a set of strings.

Documentation

Overview

Package stringset: Operations on a set of strings

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StringSet

type StringSet struct {
	// contains filtered or unexported fields
}

StringSet implements a set of strings

func New

func New(elements ...string) *StringSet

New returns a new StringSet containing elements

func (*StringSet) Add

func (ss *StringSet) Add(elements ...string) *StringSet

Add elements to ss and return ss to allow chained commands

func (*StringSet) AddSet added in v0.5.1

func (ss *StringSet) AddSet(ss1 *StringSet) *StringSet

AddSet adds the elements of ss1 to ss and returns ss to allow chained commands

func (*StringSet) Clone

func (ss *StringSet) Clone() *StringSet

Clone returns a deep copy of ss

func (*StringSet) Contain

func (ss *StringSet) Contain(s string) bool

Contain returns true iff ss contains s

func (*StringSet) Elements added in v1.0.0

func (ss *StringSet) Elements() []string

Elements returns a slice containing the elements of ss

func (*StringSet) ElementsSorted added in v1.2.0

func (ss *StringSet) ElementsSorted() []string

ElementsSorted returns a slice containing the elements of ss sorted lexicographically

func (*StringSet) Equal

func (ss *StringSet) Equal(ss1 *StringSet) bool

Equal returns true iff ss and ss1 have exactly the same elements

func (*StringSet) Len added in v1.1.0

func (ss *StringSet) Len() int

Len returns the number of elements in ss

func (*StringSet) Remove

func (ss *StringSet) Remove(element string) *StringSet

Remove element from ss and return ss to allow chained commands

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL