Answers for "delete an element from a slice golang"

Go
7

golang delete element from array

func RemoveIndex(s []string, index int) []string {
	return append(s[:index], s[index+1:]...)
}
Posted by: Guest on June-25-2020
2

go delete from slice

func remove(slice []int, s int) []int {
    return append(slice[:s], slice[s+1:]...)
}
Posted by: Guest on April-10-2020

Code answers related to "delete an element from a slice golang"

Browse Popular Code Answers by Language