strings.Count

将以下英文翻译为中文:

strings.Count

https://gohugo.io/functions/strings.count/

Returns the number of non-overlapping instances of a substring within a string.

语法

strings.Count SUBSTR STRING

If SUBSTR is an empty string, this function returns 1 plus the number of Unicode code points in STRING.

ExampleResult
`{{ “aaabaab”strings.Count “a” }}`
`{{ “aaabaab”strings.Count “aa” }}`
`{{ “aaabaab”strings.Count “aaa” }}`
`{{ “aaabaab”strings.Count "" }}`

另请参阅