mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-25 22:00:58 +02:00
Merge commit 'e509cac533600cf4fa8382c9cdab78ddd82db688'
This commit is contained in:
29
docs/content/en/functions/strings/CountRunes.md
Normal file
29
docs/content/en/functions/strings/CountRunes.md
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
title: strings.CountRunes
|
||||
linkTitle: countrunes
|
||||
description: Returns the number of runes in a string excluding whitespace.
|
||||
categories: [functions]
|
||||
keywords: []
|
||||
menu:
|
||||
docs:
|
||||
parent: functions
|
||||
function:
|
||||
aliases: [countrunes]
|
||||
returnType: int
|
||||
signatures: [strings.CountRunes INPUT]
|
||||
relatedFunctions:
|
||||
- len
|
||||
- strings.Count
|
||||
- strings.CountRunes
|
||||
- strings.CountWords
|
||||
- strings.RuneCount
|
||||
aliases: [/functions/countrunes]
|
||||
---
|
||||
|
||||
In contrast with the [`strings.RuneCount`] function, which counts every rune in a string, `strings.CountRunes` excludes whitespace.
|
||||
|
||||
```go-html-template
|
||||
{{ "Hello, 世界" | strings.CountRunes }} → 8
|
||||
```
|
||||
|
||||
[`strings.RuneCount`]: /functions/strings/runecount
|
Reference in New Issue
Block a user