stringslice

package
v0.0.626 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 2 Imported by: 40

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 Reverse added in v0.0.167

func Reverse(s []string) []string

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