mirror of
https://github.com/johndoe6345789/AutoMetabuilder.git
synced 2026-05-04 02:34:54 +00:00
4776082c34
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
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}
|