JSON TransformString
trim
Remove whitespace from both ends of a string
trim
Removes leading and trailing whitespace from a string.
Options
This operation takes no options; pass an empty object or omit options entirely.
Example
Input
" hello world "Operation
{ "type": "trim" }Output
"hello world"In a Circuit Step
{
"name": "trim_user_input",
"description": "Trim leading and trailing whitespace from user input",
"function": "circuit.core.transform.json",
"input": {
"source": "${{ input.raw_query }}",
"operations": [
{ "type": "trim" }
]
},
"outputs": [
{
"name": "clean_query",
"description": "User input with surrounding whitespace removed",
"value": "${{ trim_user_input.output.transformed_result }}"
}
]
}