JSON TransformString
trimEnd
Remove trailing whitespace from a string
trimEnd
Removes trailing whitespace from a string. Leading whitespace is preserved.
Options
This operation takes no options; pass an empty object or omit options entirely.
Example
Input
" hello "Operation
{ "type": "trimEnd" }Output
" hello"In a Circuit Step
{
"name": "trim_trailing_newline",
"description": "Strip the trailing newline from a fetched response body",
"function": "circuit.core.transform.json",
"input": {
"source": "${{ fetch_response.output.text_body }}",
"operations": [
{ "type": "trimEnd" }
]
},
"outputs": [
{
"name": "body_without_trailing_ws",
"description": "Response body with trailing whitespace removed",
"value": "${{ trim_trailing_newline.output.transformed_result }}"
}
]
}