strings.Split
Returns a slice of strings by splitting the given string by a delimiter.
Syntax
strings.Split STRING DELIM
Returns
[]string
Alias
split
Examples:
{{ split "tag1,tag2,tag3" "," }} → ["tag1", "tag2", "tag3"]
{{ split "abc" "" }} → ["a", "b", "c"]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.
Last updated:
April 10, 2025
:
Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65' (283e97783)
Improve this page