terraform/website/docs/configuration/functions/split.html.md
Nick Fagerlund 596e529602 website: Adopt a ton of pages into the "language" layout
As of this commit, that layout doesn't exist yet, but I'm isolating the one-line
changes to their own commit to try and keep your eyes from glazing over.
2020-10-26 18:19:26 -07:00

894 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

-> Note: This page is about Terraform 0.12 and later. For Terraform 0.11 and earlier, see 0.11 Configuration Language: Interpolation Syntax.

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.