Skip to main content

charAt

Returns the character at the given index.

Zero-based indexing applies, so the first character is at index 0, the second is at index 1, and so on.

Blank spaces count as characters.

Parameters

  • STRING (string)

    The input string.

  • INDEX (number)

    The index value.

Examples

ATL in Script

Result

[[charAt('All work and no play makes Jack a dull boy', 0)]]

A

[[charAt('All work and no play makes Jack a dull boy', 2)]]

l

[[charAt('All work and no play makes Jack a dull boy', 4)]]

w

[[charAt('All work and no play makes Jack a dull boy', 10)]]

n

[[charAt('All work and no play makes Jack a dull boy', 27)]]

J

To get a subset of the input string, use the syntax for string slicing instead.

ATL in Script

Result

[[myString = 'All work and no play makes Jack a dull boy'; myString[0:3]]]

All

[[myString = 'All work and no play makes Jack a dull boy'; myString[-1: ]]]

y