Documentation ¶
Index ¶
- func Apply[T any](v *[]T, fn func(int, T) T, inplace bool) []T
- func Count[T comparable](data []T, target T) int
- func EachSlice(slice []int, size int) <-chan []int
- func Filter[T any](slice []T, f func(int, T) bool) []T
- func JoinNumber[T types.Number](n []T, delimiter string) string
- func Pad[T any](data *[]T, n int, v T) []T
- func Partition[T any](slice []T, f func(int, T) bool) ([]T, []T)
- func RemoveByIndex[T any](slice []T, s int) []T
- func RemoveByValue[T comparable](slice []T, v T) []T
- func RemoveElement(s []string, i int) []string
- func SplitEqual[T any](data []T, n int) ([][]T, []T)
- func Trim[T any](data *[]T, n int) []T
- func Unique[T constraints.Ordered](slice []T) []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Count ¶ added in v0.0.102
func Count[T comparable](data []T, target T) int
func JoinNumber ¶ added in v0.0.94
JoinNumber use a strings.Builder for concatenate the input string array. It concatenates the strings among the delimiter in input
func Pad ¶ added in v0.0.102
Pad is delegated to pad/trim the given `data` to `n`, using the value `v`
func RemoveByIndex ¶ added in v0.0.94
RemoveByIndex is delegated to remove the element of index s
func RemoveByValue ¶ added in v0.0.94
func RemoveByValue[T comparable](slice []T, v T) []T
RemoveByValue is delegated to remove the element that contains the given value
func RemoveElement ¶
RemoveElement is delegated to delete the element related to index i
func SplitEqual ¶ added in v0.0.97
SplitEqual is delegated to split the given data into slice of equal length
func Unique ¶ added in v0.0.102
func Unique[T constraints.Ordered](slice []T) []T
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.