Skip to main content

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

[[substring('01/11/2020', 7)]]

2020

[[substring('01/11/2020', -4)]]

2020

[[substring('01/11/2020', 1, 3)]]

01

[[substring('01/11/2020', 4, 6)]]

11

[[substring('01/11/2020', 1, 6)]]

01/11