跳到正文
本页尚未翻译成中文,以下为英文原文。 查看英文版

split Function ​

split produces a list by dividing a given string at all occurrences of a given separator.

hcl
split(separator, string)

Examples ​

shellsession
> split(",", "foo,bar,baz")
[
  "foo",
  "bar",
  "baz",
]
> split(",", "foo")
[
  "foo",
]
> split(",", "")
[
  "",
]
  • join performs the opposite operation: producing a string joining together a list of strings with a given separator.

基于 MPL-2.0 许可证发布。