terraform/website/docs/language/functions/split.html.md

701 B

layout page_title sidebar_current description
language split - Functions - Configuration Language docs-funcs-string-split The split function produces a list by dividing a given string at all occurrences of a given separator.

split Function

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

split(separator, string)

Examples

> 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.