mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-22 21:42:50 +02:00
Merge commit 'b9bd35d72e14932fb6588ff62b90cddef0a060fc' as 'docs'
This commit is contained in:
27
docs/content/en/functions/countrunes.md
Normal file
27
docs/content/en/functions/countrunes.md
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
title: countrunes
|
||||
description: Determines the number of runes in a string excluding any whitespace.
|
||||
godocref:
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [functions]
|
||||
menu:
|
||||
docs:
|
||||
parent: "functions"
|
||||
keywords: [counting, word count]
|
||||
signature: ["countrunes INPUT"]
|
||||
workson: []
|
||||
hugoversion:
|
||||
relatedfuncs: []
|
||||
deprecated: false
|
||||
---
|
||||
|
||||
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.
|
||||
|
||||
```
|
||||
{{ "Hello, 世界" | countrunes }}
|
||||
<!-- outputs a content length of 8 runes. -->
|
||||
```
|
||||
|
||||
[pagevars]: /variables/page/
|
Reference in New Issue
Block a user