# SPLIT

### Description

`SPLIT` splits a string by a separator and returns a list of the resulting parts. An optional third argument limits the maximum number of splits performed; the remaining unsplit portion is returned as the last element.

### Syntax

```
SPLIT(string, separator, max_splits?)
```

**Returns:** A list of strings.

### Example

```
SPLIT('a,b,c,d', ',')
```

This returns `['a', 'b', 'c', 'd']`.

### Example with max splits

```
SPLIT('a,b,c,d', ',', 2)
```

This returns `['a', 'b', 'c,d']` — only two splits are performed, so the remainder is kept as a single element.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.atfinity.io/rule-language/operators/string-operators/split.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
