mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Merge commit '534ae9c57a902aea9ed6e62390dec11fa74b7122'
This commit is contained in:
commit
df56682a10
1 changed files with 30 additions and 0 deletions
30
docs/content/en/functions/strings.Count.md
Normal file
30
docs/content/en/functions/strings.Count.md
Normal file
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
title: strings.Count
|
||||
description: Returns the number of non-overlapping instances of a substring within a string.
|
||||
godocref:
|
||||
date: 2020-09-07
|
||||
publishdate: 2020-09-07
|
||||
lastmod: 2020-09-07
|
||||
categories: [functions]
|
||||
menu:
|
||||
docs:
|
||||
parent: "functions"
|
||||
keywords: [count, counting, character count]
|
||||
signature: ["strings.Count SUBSTR STRING"]
|
||||
workson: []
|
||||
hugoversion:
|
||||
relatedfuncs: []
|
||||
deprecated: false
|
||||
aliases: []
|
||||
---
|
||||
|
||||
{{< new-in "0.74.0" >}}
|
||||
|
||||
If `SUBSTR` is an empty string, this function returns 1 plus the number of Unicode code points in `STRING`.
|
||||
|
||||
Example|Result
|
||||
:--|:--
|
||||
`{{ "aaabaab" | strings.Count "a" }}`|5
|
||||
`{{ "aaabaab" | strings.Count "aa" }}`|2
|
||||
`{{ "aaabaab" | strings.Count "aaa" }}`|1
|
||||
`{{ "aaabaab" | strings.Count "" }}`|8
|
Loading…
Reference in a new issue