mirror of
https://github.com/johndoe6345789/AutoMetabuilder.git
synced 2026-04-24 22:04:58 +00:00
16 lines
395 B
Python
16 lines
395 B
Python
"""Workflow plugin: split string."""
|
|
|
|
|
|
def run(_runtime, inputs):
|
|
"""Split string by separator."""
|
|
text = inputs.get("text", "")
|
|
separator = inputs.get("separator", " ")
|
|
max_splits = inputs.get("max_splits")
|
|
|
|
if max_splits is not None:
|
|
result = text.split(separator, max_splits)
|
|
else:
|
|
result = text.split(separator)
|
|
|
|
return {"result": result}
|