Squashed 'docs/' changes from d3eb97a33..4895c29c5
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 13 Sep 2020 19:58:53 +0000 (21:58 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 13 Sep 2020 19:58:53 +0000 (21:58 +0200)
4895c29c5 Document strings.Count function

git-subtree-dir: docs
git-subtree-split: 4895c29c5b1e090eea69dc6223b2e20e3b934a6f

content/en/functions/strings.Count.md [new file with mode: 0644]

diff --git a/content/en/functions/strings.Count.md b/content/en/functions/strings.Count.md
new file mode 100644 (file)
index 0000000..3971c7d
--- /dev/null
@@ -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