SUBSTRING
Description
Returns a substring extracted from the provided string, beginning at the start_index (inclusive) and ending at the end_index (exclusive). Indexing is zero-based.
Syntax
SUBSTRING(string, start_index, end_index) -> String
Parameters
| Parameter | Data Type | Required | Description |
|---|---|---|---|
| string | String | Yes | The original string. |
| start_index | Integer | Yes | The starting index position (inclusive). Must be non-negative. |
| end_index | Integer | Yes | The ending index position (exclusive). Must be greater than or equal to start_index. |
Example
SUBSTRING("Order SO-10056 closed", 6, 14)
-- Returns "SO-10056".
-- Extracts characters from index 6 up to, but not including, index 14.Tips
If end_index exceeds the length of the string, the substring extends to the end of the string.