JSON TransformString
split
Split a string into an array of substrings
split
Splits a string on separator, returning an array of substring elements. The optional limit caps the number of resulting parts; the final part contains the unsplit remainder.
Options
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
separator | string | Yes | — | Substring used as the split delimiter. |
limit | integer | No | — | Maximum number of parts. The last part holds the unsplit remainder. |
Example
Input
"a,b,c,d"Operation (no limit)
{ "type": "split", "options": { "separator": "," } }Output
["a", "b", "c", "d"]Operation (with limit)
{ "type": "split", "options": { "separator": ",", "limit": 2 } }Output
["a", "b,c,d"]In a Circuit Step
{
"name": "split_csv_tags",
"description": "Split a comma-separated tag string into an array",
"function": "circuit.core.transform.json",
"input": {
"source": "${{ input.tags_csv }}",
"operations": [
{ "type": "split", "options": { "separator": "," } }
]
},
"outputs": [
{
"name": "tag_list",
"description": "Array of tag strings",
"value": "${{ split_csv_tags.output.transformed_result }}"
}
]
}Notes & gotchas
- Errors with
split: expected stringif the input is not a string. separatoris treated as a literal substring, not a regex.- An empty
separatorwill split between every character in Rust'ssplitnsemantics — pass it deliberately if that's what you want. limit: 0produces an empty array;limit: 1produces the original string as a single-element array.