mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Merge commit 'e509cac533600cf4fa8382c9cdab78ddd82db688'
This commit is contained in:
30
docs/content/en/functions/strings/Split.md
Normal file
30
docs/content/en/functions/strings/Split.md
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
title: strings.Split
|
||||
linkTitle: split
|
||||
description: Returns a slice of strings by splitting STRING by DELIM.
|
||||
categories: [functions]
|
||||
keywords: []
|
||||
menu:
|
||||
docs:
|
||||
parent: functions
|
||||
function:
|
||||
aliases: [split]
|
||||
returnType: string
|
||||
signatures: [strings.Split STRING DELIM]
|
||||
relatedFunctions:
|
||||
- collections.Delimit
|
||||
- strings.Split
|
||||
aliases: [/functions/split]
|
||||
---
|
||||
|
||||
Examples:
|
||||
|
||||
```go-html-template
|
||||
{{ split "tag1,tag2,tag3" "," }} → ["tag1", "tag2", "tag3"]
|
||||
{{ split "abc" "" }} → ["a", "b", "c"]
|
||||
```
|
||||
|
||||
|
||||
{{% note %}}
|
||||
`split` essentially does the opposite of [delimit](/functions/collections/delimit). While `split` creates a slice from a string, `delimit` creates a string from a slice.
|
||||
{{% /note %}}
|
Reference in New Issue
Block a user