1
0
Fork 0
hugo/docs/content/en/functions/strings/Split.md

720 B

title description categories keywords action aliases
strings.Split Returns a slice of strings by splitting the given string by a delimiter.
aliases related returnType signatures
split
functions/collections/Delimit
string
strings.Split STRING DELIM
/functions/split

Examples:

{{ split "tag1,tag2,tag3" "," }} → ["tag1", "tag2", "tag3"]
{{ split "abc" "" }} → ["a", "b", "c"]

{{% note %}} The strings.Split function essentially does the opposite of the collections.Delimit function. While split creates a slice from a string, delimit creates a string from a slice.

{{% /note %}}