Files
AutoMetabuilder/backend/autometabuilder/workflow/plugins/string/string_trim.py
2026-01-10 13:36:29 +00:00

17 lines
382 B
Python

"""Workflow plugin: trim whitespace from string."""
def run(_runtime, inputs):
"""Trim whitespace from string."""
text = inputs.get("text", "")
mode = inputs.get("mode", "both")
if mode == "start":
result = text.lstrip()
elif mode == "end":
result = text.rstrip()
else:
result = text.strip()
return {"result": result}