JSON TransformString
repeat
Repeat a string a fixed number of times
repeat
Returns the string repeated count times, end-to-end.
Options
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
count | integer | Yes | — | Number of repetitions (must be ≥ 0). |
Example
Input
"ab"Operation
{ "type": "repeat", "options": { "count": 3 } }Output
"ababab"In a Circuit Step
{
"name": "build_separator_line",
"description": "Build a separator line by repeating a single character",
"function": "circuit.core.transform.json",
"input": {
"source": "${{ input.divider_char }}",
"operations": [
{ "type": "repeat", "options": { "count": 40 } }
]
},
"outputs": [
{
"name": "separator_line",
"description": "Divider character repeated 40 times",
"value": "${{ build_separator_line.output.transformed_result }}"
}
]
}Notes & gotchas
- Errors with
repeat: expected stringif the input is not a string. count: 0returns an empty string"".- Very large
countvalues can blow memory — Rust'sString::repeatwill panic on capacity overflow. - For "join with separator" semantics, use
joinover an array instead.