Skip to content

CHARS

Info

New in Atfinity 17.

Description

CHARS splits a string into a list of its individual characters. Non-string values are converted to their string representation first.

Use CHARS when you need to walk a string character by character, for example with map() and TO_INT to process digits.

Syntax

CHARS(string)

Returns: a list of one-character strings.

Example

CHARS('A1B')

This returns ['A', '1', 'B'].

CHARS('123').map(c => TO_INT(c))

This returns [1, 2, 3].

CHARS(1024)

This returns ['1', '0', '2', '4'] — a number is converted to its digits automatically, so no cast is needed.