How do I drop first element of slice?

{{ $UrlName := split $UrlName " " }}

{{ $NewUrlName := "" }}

{{ range after 1 $UrlName }}

{{ $NewUrlName = slice . }}

{{ end }}

This example doesn’t work, but it is the closest I can get.
For example, Here I need the code that drops “one” and keeps the rest of the slice in one string. {{ $data := slice "one" "two" "three" "four" "five" "six" }}

Thanks upfront!

There is a handy function delimit for concat elements of slice to string with the delimiter.

{{ $data := slice "one" "two" "three" "four" "five" "six" }}
{{ delimit (after 1 $data) " " }}
1 Like

Thank you very much for the fast and very helpful response!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.