mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-17 07:24:52 -04:00
Fix strings.Repeat documentation
Argument order was reversed.
This commit is contained in:
parent
09b49debb1
commit
d42f6d8eb0
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: strings.Repeat
|
title: strings.Repeat
|
||||||
# linktitle:
|
# linktitle:
|
||||||
description: Returns a string consisting of count copies of the string s.
|
description: Returns INPUT repeated COUNT times.
|
||||||
godocref:
|
godocref:
|
||||||
date: 2018-05-31
|
date: 2018-05-31
|
||||||
publishdate: 2018-05-31
|
publishdate: 2018-05-31
|
||||||
@ -11,21 +11,14 @@ menu:
|
|||||||
docs:
|
docs:
|
||||||
parent: "functions"
|
parent: "functions"
|
||||||
keywords: [strings]
|
keywords: [strings]
|
||||||
signature: ["strings.Repeat INPUT COUNT"]
|
signature: ["strings.Repeat COUNT INPUT"]
|
||||||
workson: []
|
workson: []
|
||||||
hugoversion:
|
hugoversion:
|
||||||
relatedfuncs: []
|
relatedfuncs: []
|
||||||
deprecated: false
|
deprecated: false
|
||||||
---
|
---
|
||||||
|
|
||||||
`strings.Repeat` provides the Go [`strings.Repeat`](https://golang.org/pkg/strings/#Repeat) function for Hugo templates. It takes a string and a count, and returns a string with consisting of count copies of the string argument.
|
|
||||||
|
|
||||||
```
|
|
||||||
{{ strings.Repeat "yo" 3 }} → "yoyoyo"
|
|
||||||
```
|
|
||||||
|
|
||||||
`strings.Repeat` *requires* the second argument, which tells the function how many times to repeat the first argument; there is no default. However, it can be used as a pipeline:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
{{ strings.Repeat 3 "yo" }} → "yoyoyo"
|
||||||
{{ "yo" | strings.Repeat 3 }} → "yoyoyo"
|
{{ "yo" | strings.Repeat 3 }} → "yoyoyo"
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user