mirror of
https://github.com/johndoe6345789/AutoMetabuilder.git
synced 2026-04-25 14:25:05 +00:00
13 lines
324 B
Python
13 lines
324 B
Python
"""Workflow plugin: replace in string."""
|
|
|
|
|
|
def run(_runtime, inputs):
|
|
"""Replace occurrences in string."""
|
|
text = inputs.get("text", "")
|
|
old = inputs.get("old", "")
|
|
new = inputs.get("new", "")
|
|
count = inputs.get("count", -1)
|
|
|
|
result = text.replace(old, new, count)
|
|
return {"result": result}
|