substring
Returns a substring of the input string, based on the given start and end indexes.
The first character in the input string = index 1.
Tip
You can also get substrings by string slicing. See ATL guide > Slicing for guidance.
Parameters
INPUT STRING (string)
The input string.
START INDEX (number)
The start index. The first character = index 1. The start index is inclusive. If you give a negative value, the function defines the start index by counting back from the end of the input string.
END INDEX (number)
Optional. The end index. The end index is exclusive. If you give a negative value, the function defines the end index by counting back from the end of the input string.
Default: All characters from the start index onward are included.
Examples
ATL in Script | Result |
---|---|
| 2020 |
| 2020 |
| 01 |
| 11 |
| 01/11 |