Documentation ¶
Index ¶
- func Clone[T any](list []T) []T
- func Contain[T comparable](s []T, v T) bool
- func ContainFunc[T any](s []T, f func(T) bool) bool
- func FindIndex[T comparable](s []T, v T) int
- func Insert[T any](s *[]T, index int, v T)
- func Max[T cmp.Ordered](list []T) T
- func Min[T cmp.Ordered](list []T) T
- func Remove[T any](s *[]T, index int)
- func RemoveElem[T comparable](s *[]T, v T)
- func RemoveElems[T comparable](s *[]T, beRemoved []T)
- func Shuffle[T any](list []T) []T
- func Sum[T Number](list []T) T
- type Number
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainFunc ¶ added in v1.2.6
ContainFunc 是否包含指定元素
func FindIndex ¶
func FindIndex[T comparable](s []T, v T) int
FindIndex 查找第一个匹配的元素所在的index,返回-1代表没有找到
func RemoveElems ¶ added in v1.1.7
func RemoveElems[T comparable](s *[]T, beRemoved []T)
RemoveElems 删除第一个匹配的元素
Types ¶
Click to show internal directories.
Click to hide internal directories.