Merge pull request #3 from jroessler/patch-1

Added backward substrings
This commit is contained in:
godspede
2024-09-24 11:06:56 -06:00
committed by GitHub
+6 -2
View File
@@ -10,7 +10,7 @@ class SubstringFunction:
return {
"required": {
"text": ('STRING', {"multiline": True}),
"length": ('INT', {"default": 75, "min": 0})
"length": ('INT', {"default": 75})
}
}
@@ -23,7 +23,11 @@ class SubstringFunction:
if text == "undefined":
text = ""
out = text[:length]
if length >= 0:
out = text[:length]
else:
out = text[length:]
return {"ui": {"text": (out,)}, "result": (out,)}
NODE_CLASS_MAPPINGS = {