ToolsSlice

package
v0.0.0-...-332b391 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsValue

func ContainsValue[T comparable](slice []T, s T) bool

ContainsValue 切片中是否包含元素

func RemoveRepByLoop

func RemoveRepByLoop[T comparable](slc []T) []T

RemoveRepByLoop 双重循环去重,切片中数据少时可用这种

func RemoveRepByMap

func RemoveRepByMap[T comparable](stringSlice []T) []T

RemoveRepByMap 通过map主键唯一的特性过滤重复元素

func SliceDelete

func SliceDelete[T any](slice []T, index int) (err error, c []T)

SliceDelete 删除指定位置的值

func SliceInsert

func SliceInsert[T any](slice []T, v T, index int) (err error, c []T)

SliceInsert 向指定位置插入值

func SliceInsertEx

func SliceInsertEx[T any](slice []T, v []T, index int) (err error, c []T)

SliceInsertEx 向指定位置插入slice

func SliceMoveToBegin

func SliceMoveToBegin[T any](slice []T, index int) (err error, c []T)

SliceMoveToBegin 将指定位置移到最前面

func SliceMoveToEnd

func SliceMoveToEnd[T any](slice []T, index int) (err error, c []T)

SliceMoveToEnd 将指定位置移到最后面

Types

This section is empty.

Jump to

Keyboard shortcuts

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