mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-01-02 04:01:13 -05:00
895 B
895 B
layout, page_title, sidebar_current, description
| layout | page_title | sidebar_current | description |
|---|---|---|---|
| functions | 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(",", "")
[
"",
]
Related Functions
joinperforms the opposite operation: producing a string joining together a list of strings with a given separator.