API ReferenceGE Extensionsflowgraphnodesstring
SubString (Flowgraph Node)
- **Node Name:** `SubString`
Overview
- Node Name:
SubString - Category:
simple - File:
extensions/flowgraph/nodes/string/subString.lua
Extracts a substring from the input string using start and end indices.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
value | string | The string to extract from |
Output Pins
| Pin | Type | Description |
|---|---|---|
value | string | The resulting substring |
Data Properties
| Property | Type | Default | Description |
|---|---|---|---|
from | number | 0 | Start index (1-based in Lua) |
to | number | -1 | End index (-1 means end of string) |
Behavior
init()- Sets defaultfrom = 0andto = -1.work()- Callsstring.sub(input, from, to)and outputs the result.drawMiddle()- Displaysfrom / tovalues in the node body.
How It Works
- Set the
fromandtodata properties to define the substring range. - Connect a string to the input
valuepin. - The output
valuepin receives the extracted substring.
-- Example: from = 1, to = 5
-- Input: "Hello World"
-- Output: "Hello"
-- Example: from = 7, to = -1
-- Input: "Hello World"
-- Output: "World"
-- Negative indices count from the end:
-- from = -5, to = -1 → last 5 charactersKey Dependencies
- Lua built-in
string.sub
See Also
- Format String (Flowgraph Node) - Related reference
- Match String (Flowgraph Node) - Related reference
- Concat (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide