The subString function takes source_text, start_index, and end_index as arguments. It returns a piece of text containing characters between the specified indices (including the start_index and excluding the end_index).

Note:
Index starts from 0
The start_index and/or end_index should not exceed the length of the source_text. If it exceeds, an error will be encountered during execution.
The end_index must be greater than or equal to the start_index, failing which an error will be encountered during runtime.
If start_index and end_index are the same, then the function will return an empty text.
(OR)
where,
| Parameter | Data type | Description |
| <variable> | TEXT | Variable which contains the returned text. |
| <source_text> | TEXT | The source of text on which subString function is effected. |
| <start_index> | NUMBER | The index starting from which the characters in the source text will be returned. |
<end_index> (optional) | NUMBER | The index until which the characters in the source text will be returned. If omitted, the rest of the text (from the start index) will be returned. If a negative value is specified, this param will be ignored and rest of the text (from the start index) will be returned. |