stringset

package
v0.0.0-...-a5018ba Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UniqueSort

func UniqueSort(arr []string) (result []string)

UniqueSort 利用 Set 对 arr 进行除重和排序。

func UniqueSortString

func UniqueSortString(arr []string) string

Types

type Set

type Set struct {
	Map map[string]bool
}

Set .

func From

func From(arr []string) *Set

func Intersect

func Intersect(group []*Set) *Set

Intersect 取 group 里全部集合的交集。

func NewSet

func NewSet() *Set

func (*Set) Add

func (set *Set) Add(item string)

Add .

func (*Set) Has

func (set *Set) Has(item string) bool

Has .

func (*Set) Intersect

func (set *Set) Intersect(other *Set) *Set

Intersect .

func (*Set) Slice

func (set *Set) Slice() (arr []string)

Slice converts the set to a string slice.

Jump to

Keyboard shortcuts

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