slicex

package
v0.1.43 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

切片转字符串相关

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[T comparable](source []T, target T) bool

func GroupBy added in v0.1.20

func GroupBy[K comparable, V any, T []V](keyFunc func(V) K, source T) map[K]T

GroupBy 将slice按照key分组

func Join

func Join[T any](source []T, sep string) string

func Map added in v0.1.24

func Map[SourceType, ReturnType any](source []SourceType, mapFunc func(SourceType) ReturnType) []ReturnType

func New

func New[T any]() []T

func SliceExclude

func SliceExclude[T comparable](source, exclude []T) []T

func ToStrSlice

func ToStrSlice[T any](s []T) []string

func Unique

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

Types

type Slice

type Slice[T any, ReturnType any] []T

func (Slice[T, ReturnType]) Map

func (s Slice[T, ReturnType]) Map(mapFunc func(T) ReturnType) []ReturnType

Jump to

Keyboard shortcuts

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