stringslice

package
v0.0.674 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 3 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) []string

Filter applies the provided filter function and removes all items from the slice for which the filter function returns true. Deprecated: use slices.DeleteFunc instead (changes semantics: the original slice is modified)

func Has

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

Has returns true if the needle is in the haystack (case-sensitive) Deprecated: use slices.Contains instead

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. Deprecated: use slices.Concat instead

func Reverse added in v0.0.167

func Reverse(s []string) []string

Reverse reverses the order of a string slice Deprecated: use slices.Reverse instead (changes semantics)

func TrimEmptyFilter

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

TrimEmptyFilter applies the strings.TrimFunc function and removes all empty strings Deprecated: use slices.DeleteFunc instead (changes semantics: the original slice is modified)

func TrimSpaceEmptyFilter

func TrimSpaceEmptyFilter(values []string) []string

TrimSpaceEmptyFilter applies the strings.TrimSpace function and removes all empty strings Deprecated: use slices.DeleteFunc with strings.TrimSpace instead (changes semantics: the original slice is modified)

func Unique

func Unique(i []string) []string

Unique returns the given string slice with unique values, preserving order. Consider using slices.Compact with slices.Sort instead when you don't care about order.

Types

This section is empty.

Jump to

Keyboard shortcuts

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