github.com/rabbouni145/gg@v0.47.1/docs/content/en/functions/strings.RuneCount.md (about) 1 --- 2 title: strings.RuneCount 3 description: Determines the number of runes in a string. 4 godocref: 5 date: 2018-06-01 6 publishdate: 2018-06-01 7 lastmod: 2018-06-01 8 categories: [functions] 9 menu: 10 docs: 11 parent: "functions" 12 keywords: [counting, character count, length, rune length, rune count] 13 signature: ["strings.RuneCount INPUT"] 14 workson: [] 15 hugoversion: 16 relatedfuncs: ["len", "countrunes"] 17 deprecated: false 18 aliases: [] 19 --- 20 21 In contrast with `strings.CountRunes` function, which strips HTML and whitespace before counting runes, `strings.RuneCount` simply counts all the runes in a string. It relies on the Go [`utf8.RuneCountInString`] function. 22 23 ``` 24 {{ "Hello, 世界" | strings.RuneCount }} 25 <!-- outputs a content length of 9 runes. --> 26 ``` 27 28 [`utf8.RuneCount`]: https://golang.org/pkg/unicode/utf8/#RuneCount