mirror of
https://github.com/johndoe6345789/AutoMetabuilder.git
synced 2026-05-06 03:29:37 +00:00
4776082c34
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
17 lines
382 B
Python
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}
|