--- page_title: split - Functions - Configuration Language description: |- The split function produces a list by dividing a given string at all occurrences of a given separator. --- ⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️ > [!IMPORTANT] > **Documentation Update:** Product documentation previously located in `/website` has moved to the [`hashicorp/web-unified-docs`](https://github.com/hashicorp/web-unified-docs) repository, where all product documentation is now centralized. Please make contributions directly to `web-unified-docs`, since changes to `/website` in this repository will not appear on developer.hashicorp.com. ⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️ # `split` Function `split` produces a list by dividing a given string at all occurrences of a given separator. ```hcl split(separator, string) ``` ## Examples ``` > split(",", "foo,bar,baz") [ "foo", "bar", "baz", ] > split(",", "foo") [ "foo", ] > split(",", "") [ "", ] ``` ## Related Functions * [`join`](/terraform/language/functions/join) performs the opposite operation: producing a string joining together a list of strings with a given separator.