arrayutils

package
v0.0.101 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 4 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 ContainStrings added in v0.0.97

func ContainStrings(slice []string, target string) bool

ContainStrings is delegated to verify if the given string arrays contains the target

func Filter added in v0.0.97

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

func InInt added in v0.0.26

func InInt(slice []int, target int) bool

InInt is delegated to verify if the given value is present in the target slice

func InRune added in v0.0.26

func InRune(slice []rune, target rune) bool

InRune is delegated to verify if the given value is present in the target slice

func InStrings added in v0.0.45

func InStrings(slice []string, target string) bool

InStrings is delegated to verify if the given string arrays contains the target

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 JoinStrings

func JoinStrings(strs []string, delimiter string) string

JoinStrings use a strings.Builder for concatenate the input string array. It concatenates the strings among the delimiter in input

func PadSlice added in v0.0.101

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

func RemoveByIndex added in v0.0.94

func RemoveByIndex[T types.Number](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 types.Number](slice []T, value 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 RemoveElementsFromMatrixByIndex added in v0.0.58

func RemoveElementsFromMatrixByIndex(data [][]string, j []int) [][]string

func RemoveElementsFromStringByIndex added in v0.0.25

func RemoveElementsFromStringByIndex(data []string, j []int) []string

RemoveElementsFromStringByIndex delete the element of the indexes contained in j of the data in input

func RemoveStringByIndex added in v0.0.20

func RemoveStringByIndex(slice []string, s int) []string

RemoveStringByIndex the item in position s from the input array

func RemoveStrings added in v0.0.20

func RemoveStrings(slice, toRemove []string) []string

RemoveStrings is delegated to remove the input 'toRemove' value from the given slice

func ReverseArray added in v0.0.19

func ReverseArray[T types.Number](n1 []T) []T

ReverseArray is delegated to return the inverse rappresentation of the array FIXME: Use the same array instead of allocate a new array

func ReverseArrayString added in v0.0.20

func ReverseArrayString(n1 []string) []string

ReverseArrayString is delegated to return the inverse rappresentation of the array

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 ToByte added in v0.0.69

func ToByte(slice []string, separator string) []byte

func UniqueString added in v0.0.63

func UniqueString(slice []string) []string

Types

This section is empty.

Jump to

Keyboard shortcuts

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