...

Package stringslice

import "github.com/ory/go-convenience/stringslice"
Overview
Index

Overview ▾

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

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