xslice

package
v1.15.3 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsAny

func AsAny[S ~[]E, E any](s S) []any

AsAny takes any kind of slice and returns it as []any.

func Exclude added in v1.14.0

func Exclude[S ~[]E, E comparable](s S, toExclude []E) iter.Seq[E]

Exclude returns an iterator that yields the slice elements in order, excluding the elements in toExclude.

func RemoveFirst added in v1.12.0

func RemoveFirst[S ~[]E, E any](s S) []E

RemoveFirst removes the first element from the given slice and returns the resulting slice. If the slice is empty, it returns an empty slice.

func RemoveFirstN added in v1.12.0

func RemoveFirstN[S ~[]E, E any](s S, n int) []E

RemoveFirstN removes the first "n" elements from the given slice and returns the resulting slice. If the slice is empty or "n" is larger than the length of the slice, it returns an empty slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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