1.7 KiB
1.7 KiB
Text Prefix Suffix - Per-Item Decoration
Node Purpose: Text Prefix Suffix decorates each item of the input text (or text list) with a prefix and suffix, then joins items with newline \n into a single string. Useful for adding labels, brackets, or markers uniformly per line.
Inputs
| Name | Port | Type | Default | Range | Description |
|---|---|---|---|---|---|
text |
optional | ANY | - | - | Any text or iterable; non-string iterables are converted to a list for per-item processing |
prefix |
- | STRING | "" |
- | Per-item prefix (e.g., [ or Scene: ) |
suffix |
- | STRING | "" |
- | Per-item suffix (e.g., ] or ;) |
Outputs
| Name | Type | Description |
|---|---|---|
text |
STRING | String joined with newline after applying prefix/suffix per item |
Features
- Per-item decoration: applies
prefixandsuffixto each element. - Input normalization:
- If
textis a non-string iterable (e.g., generator), it is converted to a list first; - If
textis a single string or scalar, it is wrapped into a single-item list.
- If
- Fixed separator: output is joined using newline
\n, keeping items on separate lines.
Typical Usage
- Add brackets per line:
prefix="[",suffix="]". - Add unified labels to scene descriptions:
prefix="Scene: ",suffix="".
Notes & Tips
- If you need custom separators (e.g.,
\n---\nor other composite forms), useText List to StringorString Join Multi, which support escape sequences and composite separators. - For nested lists, inner lists will participate via Python's
str(item); flatten nested structures upstream or use nodes that support flattening if needed.