slices

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[T comparable](list []T, v T) bool

Contains 是否包含

func ContainsOf

func ContainsOf[T any](list []T, f func(T) bool) bool

ContainsOf 是否包含

func Filter

func Filter[T any](list []T, f func(T) bool) []T

Filter 过滤

func Index

func Index[T comparable](list []T, v T) int

Index 查找元素的索引

func IndexOf

func IndexOf[T any](list []T, f func(T) bool) int

IndexOf 查找元素的索引

func To

func To[T, R any](list []T, f func(T) R) []R

To 转换为其他类型

func ToFilter

func ToFilter[T, R any](list []T, f func(T) (R, bool)) []R

ToFilter 过滤

func ToMap

func ToMap[T any, R comparable](list []T, f func(T) R) map[R]T

Types

This section is empty.

Jump to

Keyboard shortcuts

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