| 1 |
--- |
| 2 |
title: strings.RuneCount |
| 3 |
description: Returns the number of runes in the given string. |
| 4 |
categories: [] |
| 5 |
keywords: [] |
| 6 |
params: |
| 7 |
functions_and_methods: |
| 8 |
aliases: [] |
| 9 |
returnType: int |
| 10 |
signatures: [strings.RuneCount STRING] |
| 11 |
aliases: [/functions/strings.runecount] |
| 12 |
--- |
| 13 |
|
| 14 |
In contrast with the [`strings.CountRunes`][] function, which excludes whitespace, `strings.RuneCount` counts every rune in a string. |
| 15 |
|
| 16 |
```go-html-template |
| 17 |
{{ "Hello, 世界" | strings.RuneCount }} → 9 |
| 18 |
``` |
| 19 |
|
| 20 |
[`strings.CountRunes`]: /functions/strings/countrunes/ |