arrutil

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InArray

func InArray[T comparable](v T, arr []T) bool

InArray 判断数据是否在数组中

func Intersect

func Intersect[T comparable](arr1, arr2 []T) []T

Intersect 两个数组取交集

func Merge

func Merge[T any](arr1, arr2 []T) []T

Merge 合并两个数组

func NumbersToStrs

func NumbersToStrs[T constraints.Integer | constraints.Float](arr []T) []string

NumbersToStrs 任意类型slice转为字符串数组

func Reverse

func Reverse[T any](arr []T) []T

Reverse 反转数组

func Split

func Split[T any](arr []T, n int) (ret [][]T)

Split 将数组分为n份

func Unique

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

Unique 去重

Types

This section is empty.

Jump to

Keyboard shortcuts

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