mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-11 11:04:44 -04:00
Add string concat example to math.Add
This commit is contained in:
parent
eb20521a20
commit
42488bb097
@ -22,3 +22,14 @@ If one of the numbers is a [`float`], the result is a `float`.
|
|||||||
```
|
```
|
||||||
|
|
||||||
[`float`]: /getting-started/glossary/#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
|
||||||
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user