hugo/docs/content/en/functions/strings/Split.md
2023-10-20 09:43:56 +02:00

708 B

title linkTitle description categories keywords menu function relatedFunctions aliases
strings.Split split Returns a slice of strings by splitting STRING by DELIM.
functions
docs
parent
functions
aliases returnType signatures
split
string
strings.Split STRING DELIM
collections.Delimit
strings.Split
/functions/split

Examples:

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

{{% note %}} split essentially does the opposite of delimit. While split creates a slice from a string, delimit creates a string from a slice. {{% /note %}}