strings.RuneCount

将以下英文翻译为中文:

strings.RuneCount

https://gohugo.io/functions/strings.runecount/

Determines the number of runes in a string.

语法

strings.RuneCount INPUT

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.

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

另请参阅