I was wondering if there is an opposite function to append
.
According to the docs, append
appends one or more values to a slice and returns the resulting slice.
Is there a function that removes/deletes
one or more values to a slice and returns the resulting slice?
Example:
{{ $s := slice "a" "b" "c" }}
{{ $s = $s | delete "b"}}
{{/* $s now contains a []string with elements "a", "c" */}}
If there is no such function, what is the recommended approach to deleting a []string is in the example above?