arrayutils

package
v0.0.104 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply added in v0.0.101

func Apply[T any](v *[]T, fn func(int, T) T, inplace bool) []T

func Count added in v0.0.102

func Count[T comparable](data []T, target T) int

func EachSlice added in v0.0.104

func EachSlice(slice []int, size int) <-chan []int

func Filter added in v0.0.97

func Filter[T any](slice []T, f func(int, T) bool) []T

func JoinNumber added in v0.0.94

func JoinNumber[T types.Number](n []T, delimiter string) string

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

func Pad[T any](data *[]T, n int, v T) []T

Pad is delegated to pad/trim the given `data` to `n`, using the value `v`

func Partition added in v0.0.104

func Partition[T any](slice []T, f func(int, T) bool) ([]T, []T)

func RemoveByIndex added in v0.0.94

func RemoveByIndex[T any](slice []T, s int) []T

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

func RemoveElement(s []string, i int) []string

RemoveElement is delegated to delete the element related to index i

func SplitEqual added in v0.0.97

func SplitEqual[T any](data []T, n int) ([][]T, []T)

SplitEqual is delegated to split the given data into slice of equal length

func Trim added in v0.0.102

func Trim[T any](data *[]T, n int) []T

Trim is delegated to trim the given `data` to `n`

func Unique added in v0.0.102

func Unique[T constraints.Ordered](slice []T) []T

Types

This section is empty.

Jump to

Keyboard shortcuts

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