package sliceutil

import "github.com/bitrise-io/go-utils/sliceutil"

Index

Functions

func CleanWhitespace

func CleanWhitespace(list []string, omitEmpty bool) (items []string)

CleanWhitespace removes leading and trailing white space from each element of the input slice. Elements that end up as empty strings are excluded from the result depending on the value of the omitEmpty flag.

func IndexOfStringInSlice

func IndexOfStringInSlice(searchFor string, searchIn []string) int

IndexOfStringInSlice ...

func IsStringInSlice

func IsStringInSlice(searchFor string, searchIn []string) bool

IsStringInSlice ...

func UniqueStringSlice

func UniqueStringSlice(strs []string) []string

UniqueStringSlice - returns a cleaned up list, where every item is unique. Does NOT guarantee any ordering, the result can be in any order!

Source Files

sliceutil.go

Version
v1.0.15 (latest)
Published
May 13, 2025
Platform
linux/amd64
Imports
1 packages
Last checked
2 months ago

Tools for package owners.