hugoDocs/content/en/functions/strings.Count.md
Joe Mooring f3fb791a4f
Remove dated new-in flags (#1879)
This removes new-in flags older than v0.92.0, which was released at the
beginning of 2022.

Closes #1877
2022-11-10 21:33:45 -08:00

704 B

title description date publishdate lastmod categories menu keywords signature workson hugoversion relatedfuncs deprecated aliases
strings.Count Returns the number of non-overlapping instances of a substring within a string. 2020-09-07 2020-09-07 2020-09-07
functions
docs
parent
functions
count
counting
character count
strings.Count SUBSTR STRING
false

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