countrunes

将以下英文翻译为中文:

countrunes

https://gohugo.io/functions/countrunes/

Determines the number of runes in a string excluding any whitespace.

语法

countrunes INPUT
strings.CountRunes INPUT

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.

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

另请参阅