array

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete[T typesx.All1](a []T, b ...T) []T

Delete 删除数组中的元素

func DeleteByIndex

func DeleteByIndex[T typesx.All1](a []T, b int) []T

DeleteByIndex 删除数组中的元素

func Difference

func Difference[T typesx.All1](a, b []T) []T

Difference 差集

func Intersection

func Intersection[T typesx.All1](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 typesx.All1](a, b []T) []T

Union 并集

Types

This section is empty.

Jump to

Keyboard shortcuts

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