String Functions
String functions work on text: building entity names and comparing text attributes. Most run in action logic; FIND and LEN also work in route, arrival, and gate conditions.
| Function | What it returns |
|---|---|
CONCAT(a, b) | The two pieces of text joined together. |
LEFT(s, n) / RIGHT(s, n) | The first / last n characters. |
MID(s, start, n) | n characters starting at position start, counting from 1. |
LEN(s) | The number of characters. |
FIND(s, part) | The position of part in s, or 0 if it is not there. |
UPPER(s) / LOWER(s) | The text in upper / lower case. |
TRIM(s) | The text with leading and trailing spaces removed. |
REPLACE(s, old, new) | The text with every old replaced by new. |
Examples
Section titled “Examples”Build a label from an attribute:
SET a_Label TO CONCAT('Order_', a_OrderId)React when a status contains a word:
IF FIND(a_Status, 'Error') > 0 THEN INC v_Errors ENDIF
