String

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2019 License: Apache-2.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StringC

type StringC []string

func New

func New(values ...string) (result StringC)

New - Takes a bunch of string-values and creates a StringC out of it.

func (StringC) All

func (sc StringC) All(iteratee func(string, int, StringC) bool) bool

All - Takes a validation function. It calls the validaton function with all values and returns true if all calls returned "true". However, it will stop the moment the validation function returns "false".

func (StringC) Any

func (sc StringC) Any(iteratee func(string, int, StringC) bool) bool

Some - Similiar to "All" and "None". But it will return "true" when at least one value returns "true".

func (StringC) Asc

func (sc StringC) Asc() StringC

Asc - Sorts the slice in ascending order.

func (StringC) Contains

func (sc StringC) Contains(value string, from int, to int) bool

Contains - Checks if the slice contains a specific value. An offset and an endpoint can be present to constrain the search even further. If the values -1 are used for "from" and "to" they will fall back to their default values. from = 0; to = len(ic)

func (StringC) Desc

func (sc StringC) Desc() StringC

Desc - Sorts the slice in descending order.

func (StringC) Each

func (sc StringC) Each(iteratee func(string, int, StringC))

Each - Calls a function with every item in the slice.

func (StringC) Filter

func (sc StringC) Filter(iteratee func(string, int, StringC) bool) StringC

Filter - Takes a validation function. This validation function checks if a given value is fullfilling all requirements. The result of this function contains only values where the validation function returns "true".

func (StringC) Head

func (sc StringC) Head() (string, error)

Head - Returns the first entry of a slice.

func (StringC) IsAscSorted

func (sc StringC) IsAscSorted() bool

IsAscSorted - Checks if the slice is sorted in ascending order.

func (StringC) IsDescSorted

func (sc StringC) IsDescSorted() bool

IsDescSorted - Checks if the slice is sorted in descending order.

func (StringC) IsSorted

func (sc StringC) IsSorted() bool

IsSorted - Checks if the slice is order in ascending or descending order.

func (StringC) Map

func (sc StringC) Map(iteratee func(string, int, StringC) string) StringC

Map - Takes a transform function. This transform function will be called with all values in the slice. A new slice will be generated with the new generated values.

func (StringC) Max

func (sc StringC) Max(from int, to int) string

Max - finds the max value in the slice. A "from" and "to" can be specified to constrain the search even further.

func (StringC) Min

func (sc StringC) Min(from int, to int) string

Min - finds the min value in the slice. A "from" and "to" can be specified to constrain the search even further.

func (StringC) None

func (sc StringC) None(iteratee func(string, int, StringC) bool) bool

None - The opposite of "All"

func (StringC) Partition

func (sc StringC) Partition(iteratee func(string, int, StringC) bool) (Left StringC, Right StringC)

Partition - Takes a validaton function. It calls the the validaton function and creates two new slices based on the result. If the validaton function returns "true", it gets placed into the first slice. Otherwise it's in the second slice.

func (StringC) Push

func (sc StringC) Push(values ...string) StringC

Push - Adds one or more values at the end of the slice.

func (StringC) PushUnique

func (sc StringC) PushUnique(values ...string) StringC

PushUnique - Adds one or more values at the end of the slice if they're unique

func (StringC) Reject

func (sc StringC) Reject(iteratee func(string, int, StringC) bool) StringC

Reject - Similiar to Filter. The difference is, that only values will be added where the validaton function returns "false".

func (StringC) Remove

func (sc StringC) Remove(values ...string) StringC

Remove - A simple way to remove specific values from the slice.

func (StringC) Tail

func (sc StringC) Tail() StringC

Tail - Returns a new slice without the first item.

func (StringC) Unique

func (sc StringC) Unique() StringC

Unique - Removes all duplicate values.

Jump to

Keyboard shortcuts

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