slice

package
v0.0.0-...-0ca6807 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DedupeInts

func DedupeInts(sli []int) []int

DedupeInts returns a new slice with duplicates removed, maintains original order

func DedupeStrings

func DedupeStrings(sli []string) []string

DedupeStrings returns a new slice with duplicates removed, maintains original order

func IntersectionStrings

func IntersectionStrings(sli1, sli2 []string) []string

IntersectionStrings returns a slice of values in both argument slices, deduped

func RemoveAllInts

func RemoveAllInts(sli []int, val int) []int

RemoveAllInts returns a new slice with all instances of a given int removed

func RemoveAllStrings

func RemoveAllStrings(sli []string, val string) []string

RemoveAllStrings returns a new slice with all instances of a given string removed

func SpliceInts

func SpliceInts(sli []int, index int, items int) []int

SpliceInts removes a given number of elements starting at a given index if index + items >= len(sli) it does not throw an error

func SpliceStrings

func SpliceStrings(sli []string, index int, items int) []string

SpliceStrings removes a given number of elements starting at a given index if index + items >= len(sli) it does not throw an error

Types

This section is empty.

Jump to

Keyboard shortcuts

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