split

将以下英文翻译为中文:

split

https://gohugo.io/functions/split/

Returns a slice of strings by splitting STRING by DELIM.

语法

split STRING DELIM

Examples:

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

split essentially does the opposite of delimit. While split creates a slice from a string, delimit creates a string from a slice.

另请参阅