stringslice

package
v0.0.83 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2019 License: Apache-2.0 Imports: 2 Imported by: 41

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter

func Filter(values []string, filter func(string) bool) (ret []string)

Filter applies the provided filter function and removes all items from the slice for which the filter function returns true. This function uses append and might cause

func Has

func Has(haystack []string, needle string) bool

Has returns true if the needle is in the haystack (case-sensitive)

func HasI

func HasI(haystack []string, needle string) bool

HasI returns true if the needle is in the haystack (case-insensitive)

func Merge

func Merge(parts ...[]string) []string

Merge merges several string slices into one.

func TrimEmptyFilter

func TrimEmptyFilter(values []string, trim func(rune) bool) (ret []string)

TrimEmptyFilter applies the strings.TrimFunc function and removes all empty strings

func TrimSpaceEmptyFilter

func TrimSpaceEmptyFilter(values []string) []string

TrimSpaceEmptyFilter applies the strings.TrimSpace function and removes all empty strings

func Unique

func Unique(i []string) []string

Unique returns the given string slice with unique values.

Types

This section is empty.

Jump to

Keyboard shortcuts

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