# Range of .Params as a comma delimited string?

**URL:** <https://discourse.gohugo.io/t/range-of-params-as-a-comma-delimited-string/3161>\
**Category:** support\
**Created:** [April 20, 2016, 1:18pm UTC](https://discourse.gohugo.io/t/range-of-params-as-a-comma-delimited-string/3161 "2016-04-20T13:18:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![worthless](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/worthless/32/1511_2.png) [@worthless](https://discourse.gohugo.io/u/worthless)\
**Post date:** [April 20, 2016, 1:18pm UTC](https://discourse.gohugo.io/t/range-of-params-as-a-comma-delimited-string/3161/1 "2016-04-20T13:18:41Z")

</div>

How do you output a range of .Params as a comma delimited string without whitespace or line breaks?

 {{ range where .Site.Pages.ByDate.Reverse "Section" "listings" }} {{ if (isset .Params "solddate") }} {{ else }} {{ if (isset .Params "partnumber") }} {{ .Params.partnumber }} {{ end }} {{ end }} {{ end }} 

Desired output would look similar to this: 13312340,13312341,13312343,13312349,13312350

---

<div class="post-metadata">

**Author:** ![digitalcraftsman](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/digitalcraftsman/32/4142_2.png) [@digitalcraftsman](https://discourse.gohugo.io/u/digitalcraftsman)\
**Post date:** [April 20, 2016, 6:08pm UTC](https://discourse.gohugo.io/t/range-of-params-as-a-comma-delimited-string/3161/2 "2016-04-20T18:08:53Z")

</div>

I used the script below to separate multiple tags with a comma:

```auto
{{ if isset .Params "solddate" }}
    {{ $paramLen := len .Params.solddate }}
    {{ if gt $paramLen 0 }}
        {{ range $k, $v := .Params.solddate }}
        	{{ $v }}
	        <!-- The comma will be inserted below -->
	        {{ if lt $k (sub $paramLen 1) }},{{ end }}
        {{ end }}
    {{ end }}
{{ end }}

```

This script is a bit bulky but the next release of Hugo will provide a much more elegant syntax:

```
{{ delimit (slice "foo" "bar" "buzz") ", " }}
```

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [April 20, 2016, 6:19pm UTC](https://discourse.gohugo.io/t/range-of-params-as-a-comma-delimited-string/3161/3 "2016-04-20T18:19:51Z")

</div>

> [@digitalcraftsman](#):
>
> {{ delimit (slice “foo” “bar” “buzz”) ", " }}

I’m pretty sure that delim is part of Hugo 0.15.

---

<div class="post-metadata">

**Author:** ![digitalcraftsman](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/digitalcraftsman/32/4142_2.png) [@digitalcraftsman](https://discourse.gohugo.io/u/digitalcraftsman)\
**Post date:** [April 20, 2016, 6:45pm UTC](https://discourse.gohugo.io/t/range-of-params-as-a-comma-delimited-string/3161/4 "2016-04-20T18:45:33Z")

</div>

But not `slice`, because I’m the one who added this template func recently:

> <https://github.com/gohugoio/hugo/pull/1902>

---

<div class="post-metadata">

**Author:** ![Mikhail](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/mikhail/32/1138_2.png) [@Mikhail](https://discourse.gohugo.io/u/Mikhail)\
**Post date:** [June 8, 2016, 8:37am UTC](https://discourse.gohugo.io/t/range-of-params-as-a-comma-delimited-string/3161/5 "2016-06-08T08:37:56Z")

</div>

Are there any a new way in Hugo 0.16 to replace the comma to the dot at the end of the range output?

```auto
{{ range $authors }}
{{ . }},
{{ end }}

```
