Help us shape the future of Go! Take the 2026 Go Developer Survey

stringslice

package
v0.31.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromString added in v0.19.0

func FromString(s string, sep string) []string

FromString converts a string to a slice of strings, splitting on the sep character. Unlike strings.Split, this function will also trim whitespace from the resulting strings.

func StringSliceToIntSlice

func StringSliceToIntSlice(ss []string) ([]int, error)

StringSliceToIntSlice converts a slice of strings to a slice of ints. Returns an error if any values cannot be parsed.

func TrimSpace added in v0.30.0

func TrimSpace(s []string) []string

TrimSpace trims whitespace from each string in a slice.

func UniqueExcludeFold added in v0.31.0

func UniqueExcludeFold(values []string, exclude string) []string

UniqueExcludeFold returns a deduplicated slice of strings with the excluded string removed. The comparison is case-insensitive.

func UniqueFold added in v0.26.0

func UniqueFold(s []string) []string

Unique returns a slice containing only unique values from the provided slice. The comparison is case-insensitive.

Types

This section is empty.

Jump to

Keyboard shortcuts

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