String length
Strings
Pure
String length
Text
Result
Description
Pure function returning the number of characters in the text.
When to use
Use String length when you need to enforce length limits, validate input, or compute an offset for Substring. Connect the result to a comparison node such as Greater than? and then to Branch to branch on whether a string exceeds a character limit. For a simple empty-check, prefer Is empty? over comparing the length to zero.
Pins
Input pins
| Pin | Type | Default | Notes |
|---|---|---|---|
| Text | string | — | The string whose length is measured. An empty string returns 0. |
Output pins
| Pin | Type | Notes |
|---|---|---|
| Result | integer | The number of characters (Unicode code units) in the string. |
Example
Reject a message that exceeds 160 characters before attempting to send an SMS. Wire
the message into the Text input of String length, then connect the Result output to the
A input of Greater than? with B set to 160. Feed the Result output into the Condition
input of Branch — the True execution output routes to Fail with a descriptive error.