slicex

package
v0.0.0-...-03884a7 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append[S ~[]E, E any](s S, e E) S

Append 添加元素到数组中,返回一个新的数组,不改变原数组

func Exist

func Exist[S ~[]E, E comparable](s S, e E) bool

Exist 判断数组中是否存在指定元素

func FindDuplicates

func FindDuplicates[S ~[]E, E comparable](s S) (ret []E)

FindDuplicates 查找数组中的所有重复元素 FindDuplicates 查找切片中的所有重复元素

func Join

func Join[S ~[]E, E any](s S, sep string) string

Join ["a", "b", "c"], "," => "a,b,c"

func MapKeys

func MapKeys[M ~map[K]V, K comparable, V any](m M) []K

MapKeys 返回映射 m 中的所有键,按任意顺序返回一个键的切片

func Remove

func Remove[S ~[]E, E comparable](s S, e E) (ret S)

Remove 删除数组中指定元素,返回一个新的数组,不改变原数组

func RemoveDuplicates

func RemoveDuplicates[S ~[]E, E comparable](s S) (ret S)

RemoveDuplicates 删除数组中的重复元素,返回一个新的数组,不改变原数组

func Reverse

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

Reverse reverses a slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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