stringlist

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchFilters

func MatchFilters(filters Strings, s string) bool

Types

type FilterFunc

type FilterFunc = func(string) bool

type StringMap

type StringMap map[string]string

func (StringMap) IsEmpty

func (t StringMap) IsEmpty() bool

func (StringMap) Values

func (t StringMap) Values() Strings

type StringMapper

type StringMapper = func(string) string

type Strings

type Strings []string

func (Strings) AnyMatches

func (s Strings) AnyMatches(in string) bool

AnyMatches treats each string as a regexp and returns true if any match the input string.

func (Strings) Camel

func (s Strings) Camel() Strings

Camel applies kace.Camel to each string.

func (Strings) Contains

func (s Strings) Contains(v string) bool

Contains returns true if the param exists in the Strings.

func (Strings) ContainsAll

func (s Strings) ContainsAll(v Strings) bool

ContainsAll returns true if all of the the params exists in the Strings.

func (Strings) ContainsAny

func (s Strings) ContainsAny(v Strings) bool

ContainsAny returns true if any of the the params exists in the Strings.

func (Strings) Filter

func (s Strings) Filter(fn FilterFunc) Strings

Filter applies the given filter function fn and returns a copy of the list for each string that returned true.

func (Strings) Filters

func (s Strings) Filters(filters Strings) Strings

Filters returns the list of strings that does not match any of the regex filters.

func (Strings) Join

func (s Strings) Join(sep string) string

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.

func (Strings) Map

func (s Strings) Map(f StringMapper) Strings

Map apples the transform function f to each element and returns the mapped list.

func (Strings) Max

func (s Strings) Max() int

Max returns the length of the longest string.

func (Strings) Pascal

func (s Strings) Pascal() Strings

Pascal applies kace.Pascal to each string.

func (Strings) Sort

func (s Strings) Sort() Strings

Sort returns a copy of the list sorted.

func (Strings) Sprintf

func (s Strings) Sprintf(format string) Strings

Sprintf calls fmt.Sprintf(format, str) for every string in this value and returns the results as a new Strings.

type Strings2D

type Strings2D []Strings

type StringsMapper

type StringsMapper = func(Strings) Strings

func Mapper

func Mapper(f StringMapper) StringsMapper

Jump to

Keyboard shortcuts

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