> For the complete documentation index, see [llms.txt](https://guides.clickatell.com/release-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guides.clickatell.com/release-notes/release-notes-archive/2024-release-notes/q3-2024/self-service-chatbot/split-syntax.md).

# Split syntax

Release date: 23 July 2024

In some cases, API responses may return lengthy strings, however, you might only require a portion of that string for a specific use case. Previously, it was not possible to extract only a specific portion of the string in Chat Flow and other workarounds had to be used to solve this use case. With this release, we've introduced a **Split Syntax** feature that enables flow-builders to split variables based on a specified character, allowing for efficient extraction and use of relevant data subsets.

For example, if an API returns the full address, **“**&#x31;00 Edward Street, Bo Oakdale, Cape Town, 7530, South Africa”, the flow-builder can use the correct split syntax command and retrieve only the subset of the string they want to use, e.g., "100 Edward Street, Bellville".

{% hint style="info" %}
Read [here ](https://guides.clickatell.com/flow/variable-management-1#http-formatted-variables)for more details.
{% endhint %}

<figure><img src="https://2380245535-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl8ao2e7ogQyZBti1BuxA%2Fuploads%2FGWLFhAIEm1qjB6c1ge9M%2Fimage.png?alt=media&amp;token=7a7b8277-1e6c-4132-add5-1da312f9072d" alt="" width="375"><figcaption><p>Example of extracting different parts of a long string using a specific split syntax command.</p></figcaption></figure>

The table below shows some more examples of using this feature to extract different parts of a string.

***Command structure:** \<value>:\<delimiter>:\<position1>:\<position2>*

| Which part do you want?                        | Split syntax command                                                    | Output                      |
| ---------------------------------------------- | ----------------------------------------------------------------------- | --------------------------- |
| Extract only the first portion of the address. | \[\[100 Edward Road, Bo Oakdale, Cape Town, 7530, South Africa:, :0]]   | 100 Edward Road             |
| Extract only the last portion of the address.  | \[\[100 Edward Road, Bo Oakdale, Cape Town, 7530, South Africa:, :-1]]  | South Africa                |
| Extract parts 1 to 3 of the address.           | \[\[100 Edward Road, Bo Oakdale, Cape Town, 7530, South Africa:, :1:3]] | Bo Oakdale, Cape Town, 7530 |
