Add string concat example to math.Add

This commit is contained in:
Joe Mooring
2024-01-28 08:42:30 -08:00
committed by GitHub
parent eb20521a20
commit 42488bb097
+11
View File
@@ -22,3 +22,14 @@ If one of the numbers is a [`float`], the result is a `float`.
```
[`float`]: /getting-started/glossary/#float
You can also use the `add` function to concatenate strings.
```go-html-template
{{ $s := slice "h" "u" "g" "o" }}
{{ $t := "" }}
{{ range $s }}
{{ $t = add $t . }}
{{ end }}
{{ $t }} → hugo
```