Skip to content

CHAR_CODE

Info

New in Atfinity 17.

Description

CHAR_CODE returns the Unicode code point of the first character of a string. This is useful for checksum algorithms that map letters to numbers (for example IBAN, where A maps to 10).

Syntax

CHAR_CODE(string)

Returns: the integer code point of the first character, or unknown if the argument is not a non-empty string.

Example

CHAR_CODE('A')

This returns 65.

CHAR_CODE('A') - CHAR_CODE('A') + 10

This returns 10 — the numeric value of A in the IBAN algorithm.