array

package
v0.10.17 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete[T comparable](a []T, b ...T) []T

Delete 删除数组中的元素

func DeleteByIndex

func DeleteByIndex[T comparable](a []T, b int) []T

DeleteByIndex 删除数组中的元素

func Difference

func Difference[T comparable](a, b []T) []T

Difference 差集

func Intersection

func Intersection[T comparable](a, b []T) []T

Intersection 交集

func IsIn

func IsIn[T interface{}](a []T, b T) bool

IsIn 判断元素是否在数组中

func RandomSelection added in v0.9.5

func RandomSelection[T any](input []T, n int) []T

随机选择 n 个元素并返回新的切片

func Union

func Union[T comparable](a, b []T) []T

Union 并集

func Unique added in v0.10.11

func Unique[T comparable](a []T) []T

Unique 去重

Types

type IAny added in v0.10.11

type IAny interface{}

Jump to

Keyboard shortcuts

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