String Operation¶
Performs a wide range of string and list manipulations based on a selected operation. Supports comparisons, searching, slicing, transformations (case change, strip/trim, replace), splitting/joining, random selection, and generation/repetition. Many operations accept auxiliary inputs for patterns, indexes, counts, and separators, with optional text parameters that can override auxiliary inputs.

Usage¶
Use this node whenever you need to transform or analyze textual data or lists of strings as part of a workflow. Choose an operation and provide the required inputs: for example, use FIND to locate a substring, REPLACE to substitute text, SPLIT to break a string into a list, JOIN to glue a list into a string, or RANDOM_ELEMENT to pick an item from a list. The node returns the processed value (output) and a secondary result indicating success, counts, indexes, or lengths depending on the operation.
Inputs¶
| Field | Required | Type | Description | Example |
|---|---|---|---|---|
| input | True | WILDCARD | Primary value to process. Can be a string or a list (commonly a list of strings). | Hello World |
| operation | True | STRING | Operation to perform. One of: COMPARE, CONCATENATE, COUNT, ENDS_WITH, EXTRACT_BETWEEN, FIND, GENERATE, GET_LINE, IS_ALPHA, IS_NUMERIC, JOIN, LENGTH, LOWERCASE, PROPERCASE, REPLACE, RANDOM_INPUT, RANDOM_ELEMENT, REVERSE, SLICE, SPLIT, SPLIT_LINES, STARTS_WITH, STRIP, TO_LIST, TO_STRING, TRIM_SPACES, UPPERCASE. | FIND |
| start_from_end | True | BOOLEAN | If true, many operations evaluate from the end. For strings this typically uses the reversed string; for lists it may use the last element or reverse before processing. Many operations will reset this flag internally after handling. | false |
| case_insensitive | True | BOOLEAN | If true, supported operations perform case-insensitive matching (e.g., FIND/STARTS_WITH/ENDS_WITH/REPLACE/COUNT/STRIP variants). | true |
| aux1 | False | WILDCARD | Auxiliary input 1. Meaning depends on operation (e.g., pattern/substring, repeat count, separator, index). Overridden by param1 if provided. | World |
| aux2 | False | WILDCARD | Auxiliary input 2. Meaning depends on operation (e.g., replacement text, index, max splits, slice stop/step). Overridden by param2 if provided. | Universe |
| aux3 | False | WILDCARD | Auxiliary input 3. Meaning depends on operation (e.g., replace count, slice step). Overridden by param3 if provided. | 1 |
| param1 | False | STRING | Optional text parameter that, if not empty, replaces aux1 for the operation. | hello |
| param2 | False | STRING | Optional text parameter that, if not empty, replaces aux2 for the operation. | , |
| param3 | False | STRING | Optional text parameter that, if not empty, replaces aux3 for the operation. | 3 |
Outputs¶
| Field | Type | Description | Example |
|---|---|---|---|
| output | WILDCARD | The processed value after applying the operation. Type depends on the operation (string or list). | Hello Universe |
| result | WILDCARD | Operation-specific result: may be True/False (success), an integer (index, length, count), or a list of integers for list-wise searches. | True |
Important Notes¶
- Parameter override: If param1/param2/param3 are non-empty strings, they override aux1/aux2/aux3 respectively.
- Start-from-end behavior: When start_from_end is true, strings are typically processed in reverse and may be reversed back after processing. Many operations explicitly reset this flag internally to avoid double reversing.
- List vs String: Some operations expect specific types. RANDOM_ELEMENT requires a list. SPLIT and SPLIT_LINES require a string and will raise an error if a list is provided.
- Case-insensitive matching: When case_insensitive is true, supported operations use case-insensitive logic (e.g., regex IGNORECASE for REPLACE, lowercased comparisons for FIND/STARTS_WITH/ENDS_WITH).
- GET_LINE indexing: For strings, GET_LINE uses 1-based line numbers (aux1 must be > 0). For lists, it uses 0-based indexing; with start_from_end, negative indexing is applied.
- REPLACE count: If aux3 is 0 or not provided, replacement is treated as unlimited (i or count becomes -1).
- SPLIT max splits: For SPLIT, aux2 is the max splits; 0 means unlimited.
- JOIN behavior: JOIN uses aux1 as the separator to join elements of the input list into a string. It fails (result False) if input isn't iterable of strings or coercible.
- RANDOM_ELEMENT pop: If aux1 is truthy, RANDOM_ELEMENT removes (pop) and returns a random element; otherwise it returns a random element without modifying the list.
- TO_LIST conversion: Converts a string into a list of characters; a list input is passed through.
Troubleshooting¶
- Unexpected False result: Ensure input types match the operation (e.g., SPLIT on strings only; RANDOM_ELEMENT on lists).
- Index errors in GET_LINE: For strings, provide a positive line number (starting at 1). For lists, ensure the index is within range; consider disabling start_from_end if indexing becomes negative unexpectedly.
- No changes from REPLACE: Verify aux1 (pattern) and aux2 (replacement) are set. For case-insensitive replacements, set case_insensitive to true. If no matches, output remains unchanged and result is True.
- FIND returns -1: The substring wasn’t found. Check case_insensitive and aux2/aux3 (start and end positions) if used. When applied to lists, inspect the per-element results.
- JOIN fails: Make sure input is a list of strings or objects that can be converted to strings. Provide a separator in aux1 (default is empty string if not provided).
- SPLIT/SPLIT_LINES errors: These operations do not accept list inputs. Convert to a single string first (e.g., JOIN) or use TO_STRING where appropriate.
- IS_NUMERIC is False: The value might contain non-numeric characters or be a list. Provide a plain numeric string or number-like input.
- Unexpected reversal of text: If output appears reversed, ensure start_from_end is set correctly. Many operations reset it internally, but some outcomes can still reflect reversed processing.