mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-14 20:37:55 -05:00
35 lines
681 B
Markdown
35 lines
681 B
Markdown
---
|
|||
title: slice
|
|||
# linktitle: slice
|
|||
description: Creates a alice (array) of all passed arguments.
|
|||
godocref:
|
|||
date: 2017-02-01
|
|||
publishdate: 2017-02-01
|
|||
lastmod: 2017-02-01
|
|||
categories: [functions]
|
|||
menu:
|
|||
docs:
|
|||
parent: "functions"
|
|||
#tags: [slice, array, interface]
|
|||
signature: ["slice ITEM..."]
|
|||
workson: []
|
|||
hugoversion:
|
|||
relatedfuncs: []
|
|||
deprecated: false
|
|||
draft: false
|
|||
aliases: []
|
|||
toc: false
|
|||
---
|
|||
|
|||
One use case is the concatenation of elements in combination with the [`delimit` function][]:
|
|||
|
|||
{{% code file="slice.html" %}}
|
|||
```html
|
|||
{{ delimit (slice "foo" "bar" "buzz") ", " }}
|
|||
<!-- returns the string "foo, bar, buzz" -->
|
|||
```
|
|||
{{% /code %}}
|
|||
|
|||
|
|||
[`delimit` function]: /functions/delimit/
|