fn::split
The fn::split built-in function splits a string into a list of strings using a given delimiter. If any input to fn::split is a secret, the result is also a secret.
Declaration
fn::split: [ delimiter, value ]
Parameters
| Property | Type | Description |
|---|---|---|
delimiter | string | The delimiter to use when splitting the string |
value | string | The string to split |
Returns
A list of strings created by splitting value by delimiter.
Example
Definition
values:
joined-string: "one, two, three"
split:
fn::split: [ ", ", ${joined-string} ]
Evaluated result
{
"joined-string": "one, two, three",
"split": [
"one",
"two",
"three"
]
}
Thank you for your feedback!
If you have a question about how to use Pulumi, reach out in Community Slack.
Open an issue on GitHub to report a problem or suggest an improvement.
