hugo/content/en/functions/strings.RuneCount.md
Bjørn Erik Pedersen b9bd35d72e Squashed 'docs/' content from commit fdea5430f
git-subtree-dir: docs
git-subtree-split: fdea5430f89dfd849d39212abdf5ace0a4763e5a
2019-10-21 10:22:28 +02:00

811 B

title description godocref date publishdate lastmod categories menu keywords signature workson hugoversion relatedfuncs deprecated aliases
strings.RuneCount Determines the number of runes in a string. 2018-06-01 2018-06-01 2018-06-01
functions
docs
parent
functions
counting
character count
length
rune length
rune count
strings.RuneCount INPUT
len
countrunes
false

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.

{{ "Hello, 世界" | strings.RuneCount }}
<!-- outputs a content length of 9 runes. -->