Documentation ¶
Overview ¶
切片转字符串相关
Index ¶
- func Contains[T comparable](source []T, target T) bool
- func GroupBy[K comparable, V any, T []V](keyFunc func(V) K, source T) map[K]T
- func Join[T any](source []T, sep string) string
- func New[T any]() []T
- func SliceExclude[T comparable](source, exclude []T) []T
- func ToStrSlice[T any](s []T) []string
- func Unique[T comparable](source []T) []T
- type Slice
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 SliceExclude ¶
func SliceExclude[T comparable](source, exclude []T) []T
func ToStrSlice ¶
func Unique ¶
func Unique[T comparable](source []T) []T
Types ¶
Click to show internal directories.
Click to hide internal directories.