hugoDocs/content/functions/countrunes.md
2017-03-27 16:32:31 -05:00

783 B

title linktitle description godocref date publishdate lastmod categories tags ns signature workson hugoversion relatedfuncs deprecated aliases
countrunes countrunes Determines the number of runes in a string and excludes any whitespace. 2017-02-01 2017-02-01 2017-02-01
functions
counting
word count
countrunes INPUT
false
/functions/countrunes/
/functions/countwords/

In contrast with countwords function, which counts every word in a string, the countrunes function determines the number of runes in the content and excludes any whitespace. This has specific utility if you are dealing with CJK-like languages.

{{ "Hello, 世界" | countrunes }}
<!-- outputs a content length of 8 runes. -->