hugo

Fork of github.com/gohugoio/hugo with reverse pagination support

git clone git://git.shimmy1996.com/hugo.git

strings.RuneCount.md (802B)

    1 ---
    2 title: strings.RuneCount
    3 description: Determines the number of runes in a string.
    4 date: 2018-06-01
    5 publishdate: 2018-06-01
    6 lastmod: 2018-06-01
    7 categories: [functions]
    8 menu:
    9   docs:
   10     parent: "functions"
   11 keywords: [counting, character count, length, rune length, rune count]
   12 signature: ["strings.RuneCount INPUT"]
   13 workson: []
   14 hugoversion:
   15 relatedfuncs: ["len", "countrunes"]
   16 deprecated: false
   17 aliases: []
   18 ---
   19 
   20 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.
   21 
   22 ```
   23 {{ "Hello, δΈ–η•Œ" | strings.RuneCount }}
   24 <!-- outputs a content length of 9 runes. -->
   25 ```
   26 
   27 [`utf8.RuneCount`]: https://golang.org/pkg/unicode/utf8/#RuneCount